-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.prod.yml
136 lines (129 loc) · 3.96 KB
/
docker-compose.prod.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
services:
corn-postgres:
container_name: corn-postgres
image: postgres:alpine
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=none
- POSTGRES_DB=corn
ports:
- "5000:5432"
healthcheck:
test: "pg_isready -U postgres"
interval: 1s
retries: 50
start_period: 5s
timeout: 3s
corn-backend:
container_name: corn-backend
image: corn-backend
depends_on:
corn-postgres:
condition: service_healthy
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=none
- POSTGRES_DB=corn
- SPRING_DATASOURCE_URL=jdbc:postgresql://corn-postgres:5432/corn
- FRONTEND_URL=corn-frontend
build:
context: corn-backend
dockerfile: Dockerfile.prod
healthcheck:
test: "curl -f http://localhost:8081/actuator/health"
interval: 1s
retries: 120
start_period: 15s
timeout: 5s
corn-frontend:
container_name: corn-frontend
image: corn-frontend
depends_on:
- corn-backend
build:
context: corn-frontend
dockerfile: Dockerfile.prod
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:80"]
interval: 1s
retries: 120
start_period: 15s
timeout: 5s
corn-keycloak-initializer:
container_name: corn-keycloak-initializer
image: corn-keycloak-initializer
build:
context: auth-server/keycloak-initializer
dockerfile: Dockerfile.prod
depends_on:
corn-keycloak:
condition: service_healthy
environment:
- KCCFG_OVERRIDE_EXISTING=false
- KCCFG_LOGIN_THEME_NAME=corn
- KCCFG_ACCOUNT_THEME_NAME=corn
- KC_SERVER_URL=http://corn-keycloak:8080
corn-keycloak:
container_name: corn-keycloak
image: corn-keycloak
build:
context: auth-server/keycloak-theme
dockerfile: Dockerfile.keycloak.prod
depends_on:
corn-keycloak-postgres:
condition: service_healthy
environment:
- KC_DB=postgres
- KC_DB_URL=jdbc:postgresql://corn-keycloak-postgres:5432/keycloak
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- KC_DB_USERNAME=keycloak
- KC_DB_PASSWORD=none
command: start-dev
ports:
- '8083:8080'
healthcheck:
test: "curl -f http://localhost:8080/admin || exit 1"
interval: 1s
retries: 120
start_period: 15s
timeout: 5s
corn-keycloak-postgres:
container_name: corn-keycloak-postgres
image: postgres:alpine
environment:
- POSTGRES_DB=keycloak
- POSTGRES_USER=keycloak
- POSTGRES_PASSWORD=none
ports:
- "5001:5432"
healthcheck:
test: "pg_isready -U keycloak"
interval: 1s
retries: 50
start_period: 5s
timeout: 3s
corn-nginx:
container_name: corn-nginx
image: corn-nginx
environment:
- FRONTEND_PORT_CONTAINER=80
build:
context: nginx
dockerfile: Dockerfile.dev
depends_on:
corn-backend:
condition: service_healthy
corn-frontend:
condition: service_healthy
corn-keycloak:
condition: service_healthy
healthcheck:
test: "curl -f http://localhost:4200 || exit 1"
interval: 1s
retries: 120
start_period: 15s
timeout: 5s
ports:
- "4200:4200"
- "8081:8080"