diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..a7a837880 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +.git +.github +.vscode +coverage +docs +e2e +node_modules +scripts +src diff --git a/.env b/.env new file mode 100644 index 000000000..c0235eaab --- /dev/null +++ b/.env @@ -0,0 +1,5 @@ +ALFRESCO_TAG=6.0.4-ea +SHARE_TAG=6.0.a +SOLR6_TAG=1.1.0 +POSTGRES_TAG=10.1 +ACA_TAG=development diff --git a/docker-compose.yml b/docker-compose.yml index 3ecf2b560..012911596 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,8 +1,95 @@ -version: '3.1' +version: "3" services: - app: - image: 'alfresco/content-app' - build: '.' + alfresco: + image: alfresco/alfresco-content-repository-community:${ALFRESCO_TAG} + depends_on: + - postgres + environment: + CATALINA_OPTS : " + -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n + " + JAVA_OPTS : " + -Ddb.driver=org.postgresql.Driver + -Ddb.username=alfresco + -Ddb.password=alfresco + -Ddb.url=jdbc:postgresql://postgres:5432/alfresco + -Dsolr.host=solr6 + -Dsolr.port=8983 + -Dsolr.secureComms=none + -Dsolr.base.url=/solr + -Dindex.subsystem.name=solr6 + " + networks: + - internal + ports: + - 8080:8080 #Browser port + - 8000:8000 #Debug port + + share: + image: alfresco/alfresco-share:${SHARE_TAG} + depends_on: + - alfresco + environment: + - REPO_HOST=alfresco + - REPO_PORT=8080 + networks: + - internal + ports: + - 8081:8080 + + postgres: + image: postgres:${POSTGRES_TAG} + environment: + - POSTGRES_PASSWORD=alfresco + - POSTGRES_USER=alfresco + - POSTGRES_DB=alfresco + networks: + - internal + ports: + - 5432:5432 + + solr6: + image: alfresco/alfresco-search-services:${SOLR6_TAG} + depends_on: + - alfresco + environment: + #Solr needs to know how to register itself with Alfresco + - SOLR_ALFRESCO_HOST=alfresco + - SOLR_ALFRESCO_PORT=8080 + #Alfresco needs to know how to call solr + - SOLR_SOLR_HOST=solr6 + - SOLR_SOLR_PORT=8983 + #Create the default alfresco and archive cores + - SOLR_CREATE_ALFRESCO_DEFAULTS=alfresco,archive + networks: + - internal + ports: + - 8983:8983 #Browser port + + content-app: + image: alfresco/alfresco-content-app:${ACA_TAG} + build: . + depends_on: + - alfresco + networks: + - internal + ports: + - 3001:80 + # volumes: + # - ./app.config.json:/usr/share/nginx/html/app.config.json + # - ./nginx.conf:/etc/nginx/conf.d/default.conf + + proxy: + image: nginx + depends_on: + - content-app + volumes: + - ./docker-compose/nginx.conf:/etc/nginx/conf.d/default.conf + networks: + - internal ports: - 3000:80 + +networks: + internal: diff --git a/docker-compose/.env b/docker-compose/.env index 2cd025971..c0235eaab 100644 --- a/docker-compose/.env +++ b/docker-compose/.env @@ -2,3 +2,4 @@ ALFRESCO_TAG=6.0.4-ea SHARE_TAG=6.0.a SOLR6_TAG=1.1.0 POSTGRES_TAG=10.1 +ACA_TAG=development diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 4b9ee605e..b6153d718 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -68,7 +68,7 @@ services: - 8983:8983 #Browser port content-app: - image: alfresco/alfresco-content-app:development + image: alfresco/alfresco-content-app:${ACA_TAG} depends_on: - alfresco networks: diff --git a/package.json b/package.json index b912a025a..3157a52f8 100644 --- a/package.json +++ b/package.json @@ -6,9 +6,10 @@ "ng": "ng", "start": "npm run server-versions && ng serve --open", "start:prod": "npm run server-versions && ng serve --prod --open", - "build": "npm run server-versions && ng build", + "start:docker": "docker-compose up --build", + "build": "npm run server-versions && ng build --prod", "build:prod": "npm run server-versions && ng build --prod", - "build:dev": "npm run server-versions && ng build && node postbuild-dev.js", + "build:dev": "npm run server-versions && ng build", "build:tomcat": "npm run server-versions && ng build --base-href ./", "test": "ng test --code-coverage", "test:ci": "ng test --code-coverage --single-run --no-progress && cat ./coverage/lcov.info | ./node_modules/.bin/codacy-coverage && rm -rf ./coverage", diff --git a/postbuild-dev.js b/postbuild-dev.js deleted file mode 100644 index b010b8e91..000000000 --- a/postbuild-dev.js +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * @license - * Alfresco Example Content Application - * - * Copyright (C) 2005 - 2018 Alfresco Software Limited - * - * This file is part of the Alfresco Example Content Application. - * If the software was purchased under a paid Alfresco license, the terms of - * the paid license agreement will prevail. Otherwise, the software is - * provided under the following open source license terms: - * - * The Alfresco Example Content Application is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * The Alfresco Example Content Application is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with Alfresco. If not, see . - */ - -var fs = require('fs'); -var config = require('./dist/app.config.json'); - -config.ecmHost = 'http://localhost:8080'; - -fs.writeFileSync( - './dist/app.config.json', - JSON.stringify(config, null, 4) -);