-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
98 lines (93 loc) · 2.2 KB
/
docker-compose.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
version: '3.8'
services:
backend:
build:
context: ./srcs/backend
target: ${ENV}
args:
- POSTGRES_HOST
- POSTGRES_PORT
- POSTGRES_USERNAME
- POSTGRES_PASSWORD
- POSTGRES_NAME
- JWT_SECRET
- DATABASE_URL
restart: always
container_name: backend
volumes:
- "./srcs/backend/:/app"
env_file:
- .env
depends_on:
db:
condition: service_healthy
healthcheck:
test:
[
"CMD-SHELL",
"curl -f http://localhost:4000/api/ || exit 1"
]
start_period: 10s
interval: 10s
timeout: 10s
retries: 30
db:
image: postgres:15.3
environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_NAME=${POSTGRES_NAME}
restart: always
user: postgres
container_name: db
env_file:
- .env
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
frontend:
build:
context: ./srcs/frontend
target: ${ENV}
environment:
- REACT_APP_FRONTEND_URL=${REACT_APP_FRONTEND_URL}
- REACT_APP_BACKEND_URL=${REACT_APP_BACKEND_URL}
- REACT_APP_FORTYTWO_APP_ID=${REACT_APP_FORTYTWO_APP_ID}
- REACT_APP_GITHUB_LINK=${REACT_APP_GITHUB_LINK}
restart: always
container_name: frontend
volumes:
- "./srcs/frontend/:/app"
- "./build/frontend/:/app/build"
depends_on:
backend:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8000/" ]
start_period: 10s
interval: 10s
timeout: 5s
retries: 5
proxy:
volumes:
- ./proxy/cert/:/etc/letsencrypt
build:
context: ./srcs/proxy
target: ${ENV}
restart: always
container_name: proxy
ports:
- 8080:80
env_file:
- .env
depends_on:
- backend
- frontend
volumes:
db_data: