-
Notifications
You must be signed in to change notification settings - Fork 217
/
docker-compose.yml
75 lines (69 loc) · 1.57 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
version: "3.8"
services:
mysqldb:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=pass123
- MYSQL_DATABASE=yourcar
ports:
- 3306:3306
command: --default-authentication-plugin=mysql_native_password
networks:
- shared-network
volumes:
- db-config:/etc/mysql
- db-data:/var/lib/mysql
- ./db/backup/files:/data_backup/data
nginx:
image: nginx:latest
container_name: nginx-prod
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
command: /bin/sh -c "nginx -g 'daemon off;'"
depends_on:
api-prod:
condition: service_healthy
app-prod:
condition: service_started
networks:
- shared-network
api-prod:
container_name: nestjs_api_prod
image: nestjs-api-prod:1.0.0
build:
context: nestjs-cars-app
target: production
dockerfile: Dockerfile
command: sh -c './bin/wait-for -t 0 mysqldb:3306 -- yarn start:prod'
depends_on:
- mysqldb
networks:
- shared-network
ports:
- 9000:9000
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "http://api-prod:9000"]
interval: 5s
timeout: 3s
retries: 6
app-prod:
container_name: react_app_prod
image: react-app-prod:1.0.0
build:
context: react-cars-app
target: production
dockerfile: Dockerfile
command: yarn run start:prod
ports:
- 3000:3000
networks:
- shared-network
restart: unless-stopped
networks:
shared-network:
volumes:
db-config:
db-data: