158 lines
5.2 KiB
Plaintext
158 lines
5.2 KiB
Plaintext
# ###################################
|
|
# This file is generated by puppet
|
|
# PLEASE DON'T MODIFY BY HAND
|
|
# ###################################
|
|
|
|
<% if scope.lookupvar('che::che_multiuser') == 'true' -%>
|
|
version: '2.1'
|
|
services:
|
|
<% end -%>
|
|
|
|
########################
|
|
# CHE
|
|
########################
|
|
che:
|
|
<% if scope.lookupvar('che::che_multiuser') == 'true' -%>
|
|
image: <%= ENV["IMAGE_CHE_MULTIUSER"] %>
|
|
<% else -%>
|
|
image: <%= ENV["IMAGE_CHE"] %>
|
|
<% end -%>
|
|
env_file:
|
|
<% if @compose_file_for_containers == true -%>
|
|
- '<%= ENV["CHE_CONTAINER_ROOT"] %>/instance/config/che/che.env'
|
|
<% else -%>
|
|
- '<%= ENV["CHE_ENV_FILE"] %>'
|
|
<% end -%>
|
|
<% if scope.lookupvar('che::che_multiuser') == 'true' -%>
|
|
links:
|
|
- postgres:postgres
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- default
|
|
- che-network
|
|
<% end -%>
|
|
volumes:
|
|
- '/var/run/docker.sock:/var/run/docker.sock'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/data:/data'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/logs:/logs'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/config/che:/conf'
|
|
<% if scope.lookupvar('che::che_multiuser') == 'true' -%>
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/config/che/server.xml:/home/user/eclipse-che-5.16.0-SNAPSHOT/tomcat/conf/server.xml'
|
|
<% end -%>
|
|
<% if scope.lookupvar('che::che_dev_env') == 'on' -%>
|
|
- '<%= scope.lookupvar('che::che_assembly') -%>:/assembly'
|
|
<% end -%>
|
|
<% if scope.lookupvar('che::che_user') != 'root' -%>
|
|
- '/etc/group:/etc/group:ro'
|
|
- '/etc/passwd:/etc/passwd:ro'
|
|
<% end -%>
|
|
ports:
|
|
<% if @che_jmx_enabled == 'true' -%>
|
|
- '32001:32001'
|
|
- '32101:32101'
|
|
<% end -%>
|
|
<% if scope.lookupvar('che::che_single_port') == 'true' -%>
|
|
- 8080
|
|
<% else -%>
|
|
- '<%= scope.lookupvar('che::che_port') -%>:<%= scope.lookupvar('che::che_port') -%>'
|
|
<% end -%>
|
|
<% if scope.lookupvar('che::che_env') == 'development' -%>
|
|
- '<%= scope.lookupvar('che::che_debug_port') -%>:<%= scope.lookupvar('che::che_debug_port') -%>'
|
|
<% end -%>
|
|
<% if scope.lookupvar('che::che_single_port') == 'true' -%>
|
|
labels:
|
|
traefik.che.frontend.backend: "che-server"
|
|
traefik.che.frontend.entryPoints: "http"
|
|
traefik.che.port: "<%= scope.lookupvar('che::che_port') -%>"
|
|
traefik.che.frontend.rule: "PathPrefix:/"
|
|
<% end -%>
|
|
restart: always
|
|
container_name: <%= ENV["CHE_CONTAINER_NAME"] %>
|
|
<% if scope.lookupvar('che::che_user') != 'root' -%>
|
|
user: <%= scope.lookupvar('che::che_user') -%>
|
|
<% end -%>
|
|
<% if ! @dns_resolvers.empty? -%>
|
|
<%= " dns:" + "\n" + @dns_resolvers.split(",").map { |val| " - #{val}" }.join("\n") %>
|
|
<% end -%>
|
|
|
|
<% if scope.lookupvar('che::che_single_port') == 'true' -%>
|
|
########################
|
|
# TRAEFIK
|
|
########################
|
|
traefik:
|
|
image: <%= ENV["IMAGE_TRAEFIK"] %>
|
|
command: --logLevel=DEBUG
|
|
links:
|
|
- che:che
|
|
labels:
|
|
traefik.enable: "false"
|
|
ports:
|
|
- '<%= scope.lookupvar('che::che_port') -%>:<%= scope.lookupvar('che::che_port') -%>'
|
|
<% if scope.lookupvar('che::che_env') == 'development' -%>
|
|
- '7070:7070'
|
|
<% end -%>
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/config/traefik/traefik.toml:/etc/traefik/traefik.toml'
|
|
<% end -%>
|
|
|
|
<% if scope.lookupvar('che::che_multiuser') == 'true' -%>
|
|
########################
|
|
# POSTGRES
|
|
########################
|
|
postgres:
|
|
image: <%= ENV["IMAGE_POSTGRES"] %>
|
|
environment:
|
|
- POSTGRES_USER=keycloak
|
|
- POSTGRES_PASSWORD=keycloak
|
|
- POSTGRES_DB=keycloak
|
|
volumes:
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/data/postgres:/var/lib/postgresql/data'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/config/postgres/init-che-user.sh:/docker-entrypoint-initdb.d/init-che-user.sh'
|
|
ports:
|
|
- '5432:5432'
|
|
restart: always
|
|
healthcheck:
|
|
test: "pg_isready -h localhost -p 5432 -U postgres"
|
|
interval: 10s
|
|
timeout: 10s
|
|
retries: 10
|
|
|
|
########################
|
|
# KEYCLOAK
|
|
########################
|
|
keycloak:
|
|
image: <%= ENV["IMAGE_KEYCLOACK"] %>
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
ports:
|
|
- '5050:8080'
|
|
entrypoint:
|
|
- /opt/jboss/keycloak/bin/standalone.sh
|
|
- -Dkeycloak.migration.action=import
|
|
- -Dkeycloak.migration.provider=dir
|
|
- -Dkeycloak.migration.strategy=IGNORE_EXISTING
|
|
- -Dkeycloak.migration.dir=/export
|
|
- -Djboss.bind.address=0.0.0.0
|
|
environment:
|
|
- POSTGRES_PORT_5432_TCP_ADDR=postgres
|
|
- POSTGRES_PORT_5432_TCP_PORT=5432
|
|
- POSTGRES_DATABASE=keycloak
|
|
- POSTGRES_USER=keycloak
|
|
- POSTGRES_PASSWORD=keycloak
|
|
links:
|
|
- postgres:postgres
|
|
volumes:
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/config/keycloak/che:/opt/jboss/keycloak/themes/che'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/config/keycloak/:/export'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/data/keycloak:/opt/jboss/keycloak/standalone/data'
|
|
- '<%= scope.lookupvar('che::che_instance') -%>/logs/keycloak:/opt/jboss/keycloak/standalone/log'
|
|
restart: always
|
|
|
|
networks:
|
|
che-network:
|
|
<% end -%>
|