-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
110 lines (104 loc) · 3.06 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
services:
# Frontend
front:
image: ${C2S_FRONT_IMAGE_TAG}
build:
context: front
container_name: c2s-front
volumes:
- ./docker/front/default.conf:/etc/nginx/nginx.conf
ports:
- "${C2S_FRONT_PORT:-80}:80"
restart: unless-stopped
depends_on:
- back
- keycloak
# Backend
back:
image: ${C2S_BACK_IMAGE_TAG}
build:
context: back
container_name: c2s-back
environment:
SIREN_KEYCONSUMER: ${SIREN_KEYCONSUMER}
SIREN_SECRETCONSUMER: ${SIREN_SECRETCONSUMER}
volumes:
- ./docker/back/application.properties:/etc/c2s-dev/application.properties
ports:
- "${C2S_BACK_PORT:-8081}:8081"
restart: unless-stopped
depends_on:
- postgres
# Postgres DB
postgres:
image: ${POSTGRES_IMAGE_TAG}
container_name: c2s-postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB_NAME}
PGDATA: ${POSTGRES_DATA_DIR}
volumes:
- "postgres-data:${POSTGRES_DATA_DIR}"
- ./docker/postgres/sql/create_schema.sql:/docker-entrypoint-initdb.d/create_schema.sql
command: -p 5433
ports:
- "${POSTGRES_PORT:-5433}:5433"
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB_NAME}", "-U", "${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 3
start_period: 60s
restart: unless-stopped
# Keycloak IDP
keycloak:
image: ${KEYCLOAK_IMAGE_TAG}
container_name: c2s-keycloak
command: [ 'start-dev', '--import-realm', '--http-port=${KEYCLOAK_PORT:-8080}']
environment:
KC_HOSTNAME: ${KEYCLOAK_HOSTNAME:-localhost}
KC_HOSTNAME_PORT: ${KEYCLOAK_PORT:-8080}
KC_HOSTNAME_STRICT: "false"
KC_HOSTNAME_STRICT_HTTPS: "false"
KC_HTTP_ENABLED: "true"
KC_HEALTH_ENABLED: "true"
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD}
KC_DB: postgres #DB Engine
KC_DB_URL: jdbc:postgresql://postgres:5433/${KEYCLOAK_DB_NAME}
KC_DB_USERNAME: ${POSTGRES_USER}
KC_DB_PASSWORD: ${POSTGRES_PASSWORD}
KC_PROXY_ADDRESS_FORWARDING: "true"
KC_DB_SCHEMA: ${KEYCLOAK_DB_SCHEMA}
KC_LOG_LEVEL: INFO
KC_LOG: console
KC_HOSTNAME_DEBUG: "true"
volumes:
- ./docker/keycloak/realm:/opt/keycloak/data/import
- ./docker/keycloak/theme:/opt/keycloak/themes/c2stheme
ports:
- "${KEYCLOAK_PORT:-8080}:${KEYCLOAK_PORT:-8080}"
restart: unless-stopped
depends_on:
- postgres
# PGAdmin
pgadmin:
image: ${PGADMIN_IMAGE_TAG}
container_name: c2s-pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-pgadmin4@pgadmin.org}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
PGADMIN_CONFIG_SERVER_MODE: "false"
volumes:
- pgadmin-data:/var/lib/pgadmin
ports:
- "${PGADMIN_PORT:-5050}:80"
restart: unless-stopped
depends_on:
- postgres
volumes:
postgres-data:
name: postgres-data
pgadmin-data:
name: pgadmin-data