-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
81 lines (76 loc) · 1.76 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
version: '3.3'
networks:
template-net:
name: template-net
driver: bridge
services:
mysql-prod:
image: mysql:latest
container_name: mysql-template-prod
environment:
MYSQL_ROOT_PASSWORD: '@template_123'
MYSQL_DATABASE: template_prod
MYSQL_USER: template
MYSQL_PASSWORD: '@template_123'
ports:
- "3306:3306"
volumes:
- /var/docker/volumes/template-mysql-prod:/var/lib/mysql
networks:
- template-net
mysql-dev:
image: mysql:latest
container_name: mysql-template-dev
environment:
MYSQL_ROOT_PASSWORD: '@template_123'
MYSQL_DATABASE: template_dev
MYSQL_USER: template
MYSQL_PASSWORD: '@template_123'
ports:
- "3307:3306"
volumes:
- /var/docker/volumes/template-mysql-dev:/var/lib/mysql
networks:
- template-net
bun-api:
build:
context: .
dockerfile: Dockerfile
# container_name: bun-api
environment:
NODE_ENV: production
# ports:
# - "3000:8090"
ports:
- "8090"
volumes:
- /var/docker/volumes/template-public-prod:/usr/src/app/src/presentation/public
deploy:
replicas: 1
restart_policy:
condition: on-failure
max_attempts: 3
window: 120s
depends_on:
- mysql-prod
- mysql-dev
networks:
- template-net
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "curl -f http://localhost:8090/v1/health || exit 1"]
interval: 60s
retries: 5
start_period: 20s
timeout: 10s
nginx:
image: nginx:latest
container_name: nginx-reverse-proxy
ports:
- "3000:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
depends_on:
- bun-api
networks:
- template-net