-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (51 loc) · 1.62 KB
/
docker-compose.yml
File metadata and controls
54 lines (51 loc) · 1.62 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
services:
redis:
container_name: redis1
image: redis:latest
ports:
- "6379:6379"
networks:
- yeogigallae_network
backend:
container_name: backend
build:
context: ./
dockerfile: Dockerfile
env_file:
- .env
ports:
- "8081:8080"
environment:
- MYSQL_USER=${PROD_DB_USERNAME}
- MYSQL_PASSWORD=${PROD_DB_PASSWORD}
- MYSQL_URL=jdbc:mysql://${PROD_DB_ENDPOINT}:3306/umc?serverTimezone=UTC
networks:
- yeogigallae_network
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:8080" ]
# test: [ "CMD-SHELL", "(docker logs backend 2>&1 | grep -q 'No static resource' && exit 0) || (curl -s -o /dev/null -w '%{http_code}' http://localhost:8080 | grep -qE '200|302|404' && exit 0 || exit 1)" ]
interval: 10s
timeout: 5s
retries: 5
nginx:
container_name: nginx
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- /etc/letsencrypt/live/api.yeogi.my:/etc/letsencrypt/live/api.yeogi.my:ro
- /etc/letsencrypt/archive:/etc/letsencrypt/archive:ro
- /etc/letsencrypt/privkey.pem:/etc/letsencrypt/privkey.pem:ro
depends_on:
backend:
condition: service_healthy # Backend가 정상적으로 실행된 후 시작
networks:
- yeogigallae_network
restart: always
# 동일 네트워크에서 컨테이너 간 통신을 위한 네트워크 설정
# 각 컨테이너들은 backend 와 네트워크 내부에서 통신 or 외부와 통신 가능
networks:
yeogigallae_network:
driver: bridge