-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
83 lines (78 loc) · 2.1 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
services:
db:
build: ./db
image: postgres:trancendence
container_name: postgres
restart: on-failure
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
expose:
- "5432"
volumes:
- db_data:/var/lib/postgresql/data/
networks:
- network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
backend:
depends_on:
db:
condition: service_healthy
build: ./backend
image: backend:trancendence
container_name: backend
env_file:
- .env
restart: on-failure
# TEST: 테스트를 위해 포트를 열어둠
ports:
- "8000:8000"
networks:
- network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8000/ || exit 1"]
interval: 30s
retries: 3
start_period: 30s
timeout: 10s
frontend:
build: ./frontend
image: frontend:trancendence
container_name: frontend
restart: on-failure
networks:
- network
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:5173/ || exit 1"]
interval: 30s
retries: 3
start_period: 30s
timeout: 10s
nginx:
depends_on:
backend:
condition: service_healthy
frontend:
condition: service_healthy
build: ./nginx
image: nginx:trancendence
container_name: nginx
restart: on-failure
ports:
- "443:443"
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
networks:
- network
volumes:
db_data:
networks:
network:
driver: bridge