update repository to 6.1.2-ga, SSO example (#914)

* remove old compose, update to 6.1.2-ga

* SSO with vanilla keycloak
This commit is contained in:
Denys Vuika 2019-02-03 09:42:34 +00:00 committed by Cilibiu Bogdan
parent 555946f7be
commit 80dabdd26a
10 changed files with 1889 additions and 174 deletions

146
docker-compose-keycloak.yml Normal file
View File

@ -0,0 +1,146 @@
version: '2'
services:
alfresco:
image: alfresco/alfresco-content-repository-community:6.1.2-ga
mem_limit: 1500m
depends_on:
- postgres
- auth
environment:
AUTH_SERVER_URL: ${AUTH_SERVER_URL}
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://localhost: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
-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=${AUTH_SERVER_URL}
-Didentity-service.realm=alfresco
-Didentity-service.resource=alfresco
'
networks:
- internal
ports:
- 8080:8080 #Browser port
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}
depends_on:
- alfresco
networks:
- internal
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
volumes:
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- internal
ports:
- 4000:80
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
networks:
- internal
ports:
- 8085:8080
networks:
internal:

View File

@ -1,8 +1,9 @@
version: '3'
version: '2'
services:
alfresco:
image: alfresco/alfresco-content-repository-community:6.1.0-ea
image: alfresco/alfresco-content-repository-community:6.1.2-ga
mem_limit: 1500m
depends_on:
- postgres
environment:
@ -17,8 +18,12 @@ services:
-Dsolr.base.url=/solr
-Dindex.subsystem.name=solr6
-Dshare.host=localhost
-Dalfresco.port=8080
-Daos.baseUrlOverwrite=http://localhost: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
'
networks:
- internal
@ -26,12 +31,14 @@ services:
- 8080:8080 #Browser port
share:
image: alfresco/alfresco-share:6.0.c
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:
@ -39,6 +46,7 @@ services:
postgres:
image: postgres:10.1
mem_limit: 1500m
environment:
- POSTGRES_PASSWORD=alfresco
- POSTGRES_USER=alfresco
@ -50,7 +58,8 @@ services:
- 5432:5432
solr6:
image: alfresco/alfresco-search-services:1.2.0
image: alfresco/alfresco-search-services:1.3.0-RC2
mem_limit: 2500m
depends_on:
- alfresco
environment:
@ -62,6 +71,7 @@ services:
- 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:
@ -69,6 +79,7 @@ services:
activemq:
image: alfresco/alfresco-activemq:5.15.6
mem_limit: 2048m
networks:
- internal
ports:
@ -95,11 +106,11 @@ services:
depends_on:
- content-app
volumes:
- ./docker-compose/nginx.conf:/etc/nginx/conf.d/default.conf
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- internal
ports:
- 4000:80
networks:
? internal
internal:

View File

@ -1,15 +0,0 @@
# ACA with ACS Community 6.0ea
To run ACA together with the latest ACS community (6.0) use the following command:
```sh
docker-compose up
```
The ACA is served on the port 3000.
If you want to teardown the environment, use the following command:
```sh
docker-compose down
```

View File

@ -1,94 +0,0 @@
version: "3"
services:
alfresco:
image: alfresco/alfresco-content-repository-community:6.0.7-ga
depends_on:
- postgres
environment:
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
-Ddeployment.method=DOCKER_COMPOSE
-Dcsrf.filter.enabled=false
"
networks:
- internal
ports:
- 8080:8080 #Browser port
share:
image: alfresco/alfresco-share:6.0.b
depends_on:
- alfresco
environment:
- REPO_HOST=alfresco
- REPO_PORT=8080
networks:
- internal
ports:
- 8083:8080
postgres:
image: postgres:10.1
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.1.1
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:master-latest
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:
- ./nginx.conf:/etc/nginx/conf.d/default.conf
networks:
- internal
ports:
- 3000:80
networks:
internal:

View File

@ -1,45 +0,0 @@
server {
listen *:80;
set $allowOriginSite *;
proxy_pass_request_headers on;
proxy_pass_header Set-Cookie;
access_log off;
location / {
proxy_pass http://content-app;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
}
location /alfresco/ {
proxy_pass http://alfresco:8080;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
}
location /share/ {
proxy_pass http://share:8080;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
}
}

File diff suppressed because it is too large Load Diff

29
docker/nginx.conf Normal file
View File

@ -0,0 +1,29 @@
server {
listen *:80;
set $allowOriginSite *;
proxy_pass_request_headers on;
proxy_pass_header Set-Cookie;
access_log off;
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass_header Set-Cookie;
location / {
proxy_pass http://content-app;
}
location /alfresco/ {
proxy_pass http://alfresco:8080;
}
location /share/ {
proxy_pass http://share:8080;
}
}

View File

@ -28,15 +28,5 @@ Use the following command to stop all the containers:
npm run stop:docker
```
## Preview Mode
**Tip:** With this mode, you do not need building application from source code or installing dependencies.
To run the latest published container go to the `docker-compose` folder and start docker compose from there:
```sh
cd docker-compose
docker-compose up
```
The application is available at the `http://localhost:3000` address.
You can also develop the application and run in default port (4200),
it is going to use the same docker containers automatically.

View File

@ -15,7 +15,8 @@
"wd:update": "webdriver-manager update --gecko=false",
"e2e": "npm run wd:update && protractor --baseUrl=http://localhost:4000",
"e2e.local": "npm run wd:update && protractor --baseUrl=http://localhost:4200",
"start:docker": "docker-compose up -d --build && wait-on http://localhost:8080 && wait-on http://localhost:4000",
"wait:app": "wait-on http://localhost:8080 && wait-on http://localhost:4000",
"start:docker": "docker-compose up -d --build && npm run wait:app",
"stop:docker": "docker-compose stop",
"e2e:docker": "npm run start:docker && npm run e2e && npm run stop:docker",
"spellcheck": "cspell 'src/**/*.ts' 'e2e/**/*.ts' 'projects/**/*.ts'",
@ -25,7 +26,7 @@
"build.tomcat": "npm run build -- --base-href ./ && jar -cvf docker/tomcat/artifacts/content-app.war -C dist/app/ .",
"build.tomcat.e2e": "./build-tomcat-e2e.sh",
"e2e.tomcat": "npm run wd:update && protractor --baseUrl=http://localhost:4000/content-app/",
"docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && wait-on http://localhost:8080 && wait-on http://localhost:4000",
"docker.tomcat.start": "cd docker/tomcat && docker-compose up -d --build && npm run wait:app",
"docker.tomcat.stop": "cd docker/tomcat && docker-compose stop",
"docker.tomcat.e2e": "npm run docker.tomcat.start && npm run e2e.tomcat",
"lint:staged": "lint-staged"

19
start-sso.sh Executable file
View File

@ -0,0 +1,19 @@
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)
export AUTH_SERVER_URL="http://${HOST_IP}:8085/auth"
export APP_URL="http://${HOST_IP}:4000"
export APP_CONFIG_AUTH_TYPE="OAUTH"
export APP_CONFIG_OAUTH2_HOST="${AUTH_SERVER_URL}/realms/alfresco"
export APP_CONFIG_OAUTH2_CLIENTID="alfresco"
export APP_CONFIG_OAUTH2_REDIRECT_SILENT_IFRAME_URI="${APP_URL}/assets/silent-refresh.html"
export APP_CONFIG_OAUTH2_REDIRECT_LOGIN="/"
export APP_CONFIG_OAUTH2_REDIRECT_LOGOUT="/logout"
docker-compose -f docker-compose-keycloak.yml up -d --build
echo "Waiting for the app..."
npm run wait:app
echo "Identity Service: ${AUTH_SERVER_URL}"
echo "Realm: ${APP_CONFIG_OAUTH2_HOST}"
echo "Content Workspace: ${APP_URL}"