mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-19 17:14:45 +00:00
merge docker-compose.yaml and docker-compose-keycloak.yaml to one file. Implement start.sh for starting with and without SSO.
This commit is contained in:
parent
0d0ddfcf37
commit
5be755ad4b
@ -1,210 +0,0 @@
|
|||||||
version: '2'
|
|
||||||
|
|
||||||
services:
|
|
||||||
alfresco:
|
|
||||||
image: alfresco/alfresco-content-repository-community:latest
|
|
||||||
mem_limit: 1500m
|
|
||||||
depends_on:
|
|
||||||
- auth
|
|
||||||
environment:
|
|
||||||
HOST_IP: ${HOST_IP}
|
|
||||||
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
|
|
||||||
-Dshare.host=localhost
|
|
||||||
-Dalfresco.port=8080
|
|
||||||
-Daos.baseUrlOverwrite=http://${HOST_IP}:8080/alfresco/aos
|
|
||||||
-Dmessaging.broker.url="failover:(nio://activemq:61616)?timeout=3000&jms.useCompression=true"
|
|
||||||
-Ddeployment.method=DOCKER_COMPOSE
|
|
||||||
-Dcsrf.filter.enabled=false
|
|
||||||
-Xms1g -Xmx1g
|
|
||||||
|
|
||||||
-Dlocal.transform.service.enabled=true
|
|
||||||
-DlocalTransform.pdfrenderer.url=http://alfresco-pdf-renderer:8090/
|
|
||||||
-DlocalTransform.imagemagick.url=http://imagemagick:8090/
|
|
||||||
-DlocalTransform.libreoffice.url=http://libreoffice:8090/
|
|
||||||
-DlocalTransform.tika.url=http://tika:8090/
|
|
||||||
-DlocalTransform.misc.url=http://transform-misc:8090/
|
|
||||||
|
|
||||||
-Dlegacy.transform.service.enabled=true
|
|
||||||
-Dalfresco-pdf-renderer.url=http://alfresco-pdf-renderer:8090/
|
|
||||||
-Djodconverter.url=http://libreoffice:8090/
|
|
||||||
-Dimg.url=http://imagemagick:8090/
|
|
||||||
-Dtika.url=http://tika:8090/
|
|
||||||
-Dtransform.misc.url=http://transform-misc:8090/
|
|
||||||
|
|
||||||
-Dauthentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm
|
|
||||||
-Didentity-service.enable-basic-auth=true
|
|
||||||
-Didentity-service.authentication.validation.failure.silent=false
|
|
||||||
-Didentity-service.auth-server-url=http://${HOST_IP}:8085/auth
|
|
||||||
-Didentity-service.realm=alfresco
|
|
||||||
-Didentity-service.resource=alfresco
|
|
||||||
'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8080:8080 #Browser port
|
|
||||||
|
|
||||||
alfresco-pdf-renderer:
|
|
||||||
image: alfresco/alfresco-pdf-renderer:2.1.0-EA4
|
|
||||||
environment:
|
|
||||||
JAVA_OPTS: ' -Xms256m -Xmx256m'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8090:8090
|
|
||||||
|
|
||||||
imagemagick:
|
|
||||||
image: alfresco/alfresco-imagemagick:2.1.0-EA4
|
|
||||||
environment:
|
|
||||||
JAVA_OPTS: ' -Xms256m -Xmx256m'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8091:8090
|
|
||||||
|
|
||||||
libreoffice:
|
|
||||||
image: alfresco/alfresco-libreoffice:2.1.0-EA4
|
|
||||||
environment:
|
|
||||||
JAVA_OPTS: ' -Xms256m -Xmx256m'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8092:8090
|
|
||||||
|
|
||||||
tika:
|
|
||||||
image: alfresco/alfresco-tika:2.1.0-EA4
|
|
||||||
environment:
|
|
||||||
JAVA_OPTS: ' -Xms256m -Xmx256m'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8093:8090
|
|
||||||
|
|
||||||
transform-misc:
|
|
||||||
image: alfresco/alfresco-transform-misc:2.1.0-EA4
|
|
||||||
environment:
|
|
||||||
JAVA_OPTS: ' -Xms256m -Xmx256m'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8094:8090
|
|
||||||
|
|
||||||
share:
|
|
||||||
image: alfresco/alfresco-share:6.1.0-RC3
|
|
||||||
mem_limit: 1g
|
|
||||||
depends_on:
|
|
||||||
- alfresco
|
|
||||||
environment:
|
|
||||||
- REPO_HOST=alfresco
|
|
||||||
- REPO_PORT=8080
|
|
||||||
- 'CATALINA_OPTS= -Xms500m -Xmx500m'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8083:8080
|
|
||||||
|
|
||||||
postgres:
|
|
||||||
image: postgres:10.1
|
|
||||||
mem_limit: 1500m
|
|
||||||
environment:
|
|
||||||
- POSTGRES_PASSWORD=alfresco
|
|
||||||
- POSTGRES_USER=alfresco
|
|
||||||
- POSTGRES_DB=alfresco
|
|
||||||
command: postgres -c max_connections=300 -c log_min_messages=LOG
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 5432:5432
|
|
||||||
|
|
||||||
solr6:
|
|
||||||
image: alfresco/alfresco-search-services:1.3.0-RC2
|
|
||||||
mem_limit: 2500m
|
|
||||||
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
|
|
||||||
- 'SOLR_JAVA_MEM=-Xms2g -Xmx2g'
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8983:8983 #Browser port
|
|
||||||
|
|
||||||
activemq:
|
|
||||||
image: alfresco/alfresco-activemq:5.15.6
|
|
||||||
mem_limit: 2048m
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
ports:
|
|
||||||
- 8161:8161 # Web Console
|
|
||||||
- 5672:5672 # AMQP
|
|
||||||
- 61616:61616 # OpenWire
|
|
||||||
- 61613:61613 # STOMP
|
|
||||||
|
|
||||||
content-app:
|
|
||||||
image: alfresco/alfresco-content-app:latest
|
|
||||||
build: .
|
|
||||||
environment:
|
|
||||||
# BASEPATH: ./
|
|
||||||
APP_CONFIG_OAUTH2_HOST: ${APP_CONFIG_OAUTH2_HOST}
|
|
||||||
APP_CONFIG_AUTH_TYPE: ${APP_CONFIG_AUTH_TYPE}
|
|
||||||
APP_CONFIG_OAUTH2_CLIENTID: ${APP_CONFIG_OAUTH2_CLIENTID}
|
|
||||||
APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: ${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}
|
|
||||||
APP_CONFIG_OAUTH2_REDIRECT_LOGIN: ${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}
|
|
||||||
APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: ${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
depends_on:
|
|
||||||
- alfresco
|
|
||||||
ports:
|
|
||||||
- 4001:80
|
|
||||||
# volumes:
|
|
||||||
# - ./app.config.json:/usr/share/nginx/html/app.config.json
|
|
||||||
# - ./nginx.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
proxy:
|
|
||||||
image: nginx:stable-alpine
|
|
||||||
depends_on:
|
|
||||||
- content-app
|
|
||||||
- alfresco
|
|
||||||
volumes:
|
|
||||||
- ./docker/proxy/nginx.conf:/etc/nginx/conf.d/default.conf
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
links:
|
|
||||||
- content-app
|
|
||||||
- alfresco
|
|
||||||
- share
|
|
||||||
ports:
|
|
||||||
- 8080:8080
|
|
||||||
|
|
||||||
auth:
|
|
||||||
image: jboss/keycloak:4.8.3.Final
|
|
||||||
volumes:
|
|
||||||
- ./docker/auth/alfresco-realm.json:/tmp/alfresco-realm.json
|
|
||||||
networks:
|
|
||||||
- internal
|
|
||||||
environment:
|
|
||||||
- KEYCLOAK_USER=admin
|
|
||||||
- KEYCLOAK_PASSWORD=admin
|
|
||||||
- KEYCLOAK_IMPORT=/tmp/alfresco-realm.json
|
|
||||||
- DB_VENDOR=h2
|
|
||||||
ports:
|
|
||||||
- 8085:8080
|
|
||||||
|
|
||||||
networks:
|
|
||||||
internal:
|
|
@ -4,6 +4,8 @@ services:
|
|||||||
alfresco:
|
alfresco:
|
||||||
image: alfresco/alfresco-content-repository-community:latest
|
image: alfresco/alfresco-content-repository-community:latest
|
||||||
mem_limit: 1500m
|
mem_limit: 1500m
|
||||||
|
depends_on:
|
||||||
|
- auth
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/acs-cm:/usr/local/tomcat/shared/classes/alfresco/extension
|
- ./docker/acs-cm:/usr/local/tomcat/shared/classes/alfresco/extension
|
||||||
environment:
|
environment:
|
||||||
@ -37,6 +39,14 @@ services:
|
|||||||
-Dtika.url=http://tika:8090/
|
-Dtika.url=http://tika:8090/
|
||||||
-Dtransform.misc.url=http://transform-misc:8090/
|
-Dtransform.misc.url=http://transform-misc:8090/
|
||||||
-Dcsrf.filter.enabled=false
|
-Dcsrf.filter.enabled=false
|
||||||
|
|
||||||
|
-Didentity-service.enable-basic-auth=true
|
||||||
|
-Didentity-service.authentication.validation.failure.silent=false
|
||||||
|
-Didentity-service.auth-server-url=http://${HOST_IP}:8085/auth
|
||||||
|
-Didentity-service.realm=alfresco
|
||||||
|
-Didentity-service.resource=alfresco
|
||||||
|
|
||||||
|
${AIMS_PROPS}
|
||||||
-Xms1500m -Xmx1500m
|
-Xms1500m -Xmx1500m
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -132,6 +142,15 @@ services:
|
|||||||
build: .
|
build: .
|
||||||
depends_on:
|
depends_on:
|
||||||
- alfresco
|
- alfresco
|
||||||
|
environment:
|
||||||
|
BASE_PATH: ./
|
||||||
|
APP_CONFIG_OAUTH2_HOST: ${APP_CONFIG_OAUTH2_HOST}
|
||||||
|
APP_CONFIG_AUTH_TYPE: ${APP_CONFIG_AUTH_TYPE}
|
||||||
|
APP_CONFIG_OAUTH2_CLIENTID: ${APP_CONFIG_OAUTH2_CLIENTID}
|
||||||
|
APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI: ${APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI}
|
||||||
|
APP_CONFIG_OAUTH2_REDIRECT_LOGIN: ${APP_CONFIG_OAUTH2_REDIRECT_LOGIN}
|
||||||
|
APP_CONFIG_OAUTH2_REDIRECT_LOGOUT: ${APP_CONFIG_OAUTH2_REDIRECT_LOGOUT}
|
||||||
|
APP_BASE_SHARE_URL: '{protocol}//{hostname}{:port}/workspace/#/preview/s'
|
||||||
ports:
|
ports:
|
||||||
- 4001:8080
|
- 4001:8080
|
||||||
|
|
||||||
@ -148,3 +167,15 @@ services:
|
|||||||
- alfresco
|
- alfresco
|
||||||
- share
|
- share
|
||||||
- content-app
|
- content-app
|
||||||
|
|
||||||
|
auth:
|
||||||
|
image: jboss/keycloak:4.8.3.Final
|
||||||
|
volumes:
|
||||||
|
- ./docker/auth/alfresco-realm.json:/tmp/alfresco-realm.json
|
||||||
|
environment:
|
||||||
|
- KEYCLOAK_USER=admin
|
||||||
|
- KEYCLOAK_PASSWORD=admin
|
||||||
|
- KEYCLOAK_IMPORT=/tmp/alfresco-realm.json
|
||||||
|
- DB_VENDOR=h2
|
||||||
|
ports:
|
||||||
|
- 8085:8080
|
||||||
|
@ -26,7 +26,11 @@ http {
|
|||||||
proxy_pass_header Set-Cookie;
|
proxy_pass_header Set-Cookie;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://content-app:8080;
|
proxy_pass http://alfresco:8080;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /content-app/ {
|
||||||
|
proxy_pass http://content-app:8080/;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /alfresco/ {
|
location /alfresco/ {
|
||||||
|
10
package.json
10
package.json
@ -17,12 +17,12 @@
|
|||||||
"lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck",
|
"lint": "ng lint && npm run spellcheck && npm run format:check && npm run e2e.typecheck",
|
||||||
"wd:update": "webdriver-manager update --gecko=false $VERSION_CHROME",
|
"wd:update": "webdriver-manager update --gecko=false $VERSION_CHROME",
|
||||||
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
|
"e2e.typecheck": "tsc -p ./e2e/tsconfig.e2e.typecheck.json",
|
||||||
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080} $SUITE",
|
"e2e": "npm run wd:update && protractor --baseUrl=${TEST_BASE_URL:-http://localhost:8080/content-app} $SUITE",
|
||||||
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE",
|
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200 $SUITE",
|
||||||
"wait:app": "wait-on http://localhost:8080/alfresco/ -t 1000000 && wait-on http://localhost:8080 -t 400000",
|
"wait:app": "wait-on http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/alfresco/ -t 1000000 && wait-on http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/content-app/ -t 400000",
|
||||||
"start:docker": "docker-compose up -d --build && npm run wait:app",
|
"start:docker": "./start.sh && npm run wait:app",
|
||||||
"stop:docker": "docker-compose stop",
|
"stop:docker": "./start.sh -d",
|
||||||
"e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker",
|
"e2e:docker": "./start.sh && npm run e2e && ./start.sh -d",
|
||||||
"spellcheck": "cspell '{src,e2e,projects}/**/*.ts'",
|
"spellcheck": "cspell '{src,e2e,projects}/**/*.ts'",
|
||||||
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
|
"inspect.bundle": "ng build app --prod --stats-json && npx webpack-bundle-analyzer dist/app/stats.json",
|
||||||
"format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
|
"format:check": "prettier --check \"src/{app,environments}/**/*.{ts,js,css,scss,html}\"",
|
||||||
|
96
start.sh
Executable file
96
start.sh
Executable file
@ -0,0 +1,96 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
show_help() {
|
||||||
|
echo "Usage: ./start.sh"
|
||||||
|
echo ""
|
||||||
|
echo "-k or --keycloak if you want to use keycloak as identity provider"
|
||||||
|
echo "-d or --down delete all container"
|
||||||
|
echo "-hi or --host-ip set the host ip"
|
||||||
|
echo "-hp or --host-port set the host port. Default 8080"
|
||||||
|
echo "-w or --wait wait for backend. Default true"
|
||||||
|
echo "-h or --help"
|
||||||
|
}
|
||||||
|
|
||||||
|
set_keycloak(){
|
||||||
|
KEYCLOAK="true"
|
||||||
|
}
|
||||||
|
|
||||||
|
down(){
|
||||||
|
docker-compose down
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
set_host_ip(){
|
||||||
|
SET_HOST_IP=$1
|
||||||
|
}
|
||||||
|
|
||||||
|
set_host_port(){
|
||||||
|
HOST_PORT=$1
|
||||||
|
}
|
||||||
|
|
||||||
|
set_wait(){
|
||||||
|
WAIT=$1
|
||||||
|
}
|
||||||
|
|
||||||
|
# Defaults
|
||||||
|
WAIT="true"
|
||||||
|
SET_HOST_IP=""
|
||||||
|
HOST_PORT="8080"
|
||||||
|
KEYCLOAK="false"
|
||||||
|
AIMS_PROPS=""
|
||||||
|
|
||||||
|
while [[ $1 == -* ]]; do
|
||||||
|
case "$1" in
|
||||||
|
-h|--help|-\?) show_help; exit 0;;
|
||||||
|
-k|--keycloak) set_keycloak; shift;;
|
||||||
|
-d|--down) down; shift;;
|
||||||
|
-w|--wait) set_wait $2; shift 2;;
|
||||||
|
-hi|--host-ip) set_host_ip $2; shift 2;;
|
||||||
|
-hp|--host-port) set_host_port $2; shift 2;;
|
||||||
|
-*) echo "invalid option: $1" 1>&2; show_help; exit 1;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "${SET_HOST_IP}" ];then
|
||||||
|
export HOST_IP=${SET_HOST_IP}
|
||||||
|
else
|
||||||
|
echo "No HOST_IP set, try to figure out on its own ..."
|
||||||
|
export HOST_IP=$(ifconfig | grep -E "([0-9]{1,3}\.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d: | head -n1)
|
||||||
|
fi
|
||||||
|
echo "HOST_IP: ${HOST_IP}"
|
||||||
|
|
||||||
|
URL_FRAGMENT="content-app"
|
||||||
|
export APP_URL="http://${HOST_IP}:${HOST_PORT}/${URL_FRAGMENT}"
|
||||||
|
echo "Content Workspace: ${APP_URL}"
|
||||||
|
|
||||||
|
if [[ $KEYCLOAK == "true" ]]; then
|
||||||
|
export APP_CONFIG_AUTH_TYPE="OAUTH"
|
||||||
|
export APP_CONFIG_OAUTH2_HOST="http://${HOST_IP}:8085/auth/realms/alfresco"
|
||||||
|
echo "Realm: ${APP_CONFIG_OAUTH2_HOST}"
|
||||||
|
export APP_CONFIG_OAUTH2_CLIENTID="alfresco"
|
||||||
|
export APP_CONFIG_OAUTH2_IMPLICIT_FLOW=true
|
||||||
|
export APP_CONFIG_OAUTH2_SILENT_LOGIN=true
|
||||||
|
export APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI="${APP_URL}assets/silent-refresh.html"
|
||||||
|
export APP_CONFIG_OAUTH2_REDIRECT_LOGIN="/$URL_FRAGMENT/"
|
||||||
|
export APP_CONFIG_OAUTH2_REDIRECT_LOGOUT="/$URL_FRAGMENT/logout"
|
||||||
|
# export APP_BASE_SHARE_URL="${APP_URL}#/preview/s"
|
||||||
|
|
||||||
|
AIMS_PROPS="-Dauthentication.chain=identity-service1:identity-service,alfrescoNtlm1:alfrescoNtlm"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Start docker compose"
|
||||||
|
export REGISTRY=${REGISTRY}
|
||||||
|
export SHARE_TAG=${SHARE_TAG:-latest}
|
||||||
|
export REPO_TAG=${REPO_TAG:-latest}
|
||||||
|
export AIMS_PROPS=${AIMS_PROPS}
|
||||||
|
docker-compose up -d --build
|
||||||
|
|
||||||
|
if [[ $WAIT == "true" ]]; then
|
||||||
|
echo "http://${HOST_IP:-localhost}:${HOST_PORT:-8080}/$URL_FRAGMENT/"
|
||||||
|
echo "Waiting for the app ..."
|
||||||
|
HOST_IP=$HOST_IP HOST_PORT=$HOST_PORT npm run wait:app
|
||||||
|
if [ $? == 1 ]; then
|
||||||
|
echo "Waiting failed -> exit 1"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user