-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.stage.yaml
More file actions
66 lines (62 loc) · 1.85 KB
/
compose.stage.yaml
File metadata and controls
66 lines (62 loc) · 1.85 KB
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
services:
database-stage:
container_name: database-stage
image: postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${DB_DATABASE} -U ${DB_USER}"]
interval: 20s
timeout: 10s
retries: 5
start_period: 100s
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_DATABASE}
POSTGRES_USER: ${DB_USER}
POSTGRES_HOST: ${DB_HOST}
volumes:
- ./persist/database-stage:/var/lib/postgresql
backend-stage:
restart: always
container_name: backend-stage
image: ${DOCKERHUB_USERNAME}/${DOCKERHUB_PROJECT_NAME}:backend-latest
healthcheck:
interval: 20s
retries: 10
timeout: 15s
start_period: 120s
test:
[
"CMD-SHELL",
'curl --fail --request POST --header ''Content-Type: application/json'' --url ''http://backend-stage:3000'' --data ''{"query":"query { __typename }"}'' || exit 1',
]
environment: # peut être mettre les id de docker
DB_PASSWORD: ${DB_PASSWORD}
DB_DATABASE: ${DB_DATABASE}
DB_USER: ${DB_USER}
DB_HOST: ${DB_HOST}
JWT_SECRET: ${JWT_SECRET}
depends_on:
database-stage:
condition: service_healthy
frontend-stage:
restart: always
container_name: frontend-stage
image: ${DOCKERHUB_USERNAME}/${DOCKERHUB_PROJECT_NAME}:frontend-latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
ports:
# Gateway port => "extérieur" de la porte du container : 80 => "intérieur" de la porte du container
- ${GATEWAY_PORT}:80
healthcheck:
interval: 20s
retries: 15
timeout: 20s
start_period: 120s
test:
[
"CMD-SHELL",
"curl --fail --request GET --url 'http://frontend-stage:80' || exit 1",
]
depends_on:
backend-stage:
condition: service_healthy