-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yml
92 lines (84 loc) · 1.91 KB
/
docker-compose.prod.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
services:
pg-opokedex:
build:
context: ./
dockerfile: Dockerfile.pg
container_name: pg-opokedex
restart: always
volumes:
- db_data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
env_file:
- .env
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
start_period: 15s
interval: 15s
timeout: 5s
retries: 5
networks:
- opokedex-network
back:
build:
context: ./back
dockerfile: Dockerfile.back.prod
ports:
- "5050:5050"
container_name: back-opokedex
restart: always
environment:
NODE_ENV: production
POSTGRES_URL: ${POSTGRES_URL}
volumes:
- ./back:/usr/src/app
- /usr/src/app/node_modules
depends_on:
pg-opokedex:
condition: service_healthy
networks:
- opokedex-network
front:
restart: always
build:
context: ./front
dockerfile: Dockerfile.front.prod
container_name: front-opokedex
ports:
- "5173:5173"
environment:
VITE_API_URL: ${VITE_API_URL}
NODE_ENV: production
volumes:
- ./front:/usr/src/app
- /usr/src/app/node_modules
depends_on:
- back
networks:
- opokedex-network
nginx:
image: nginx:latest
container_name: nginx-container
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
- ./certbot/www:/var/www/certbot:ro
depends_on:
- back
- front
- pg-opokedex
restart:
always
networks:
- opokedex-network
networks:
opokedex-network:
driver: bridge
volumes:
db_data: { }