forked from hexschool/2025-backend-camp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
75 lines (75 loc) · 1.55 KB
/
docker-compose.yml
File metadata and controls
75 lines (75 loc) · 1.55 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "3.8"
volumes:
pgData:
services:
postgres:
image: postgres:16.4-alpine3.20
environment:
- POSTGRES_USER=${DB_USERNAME}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_DATABASE}
volumes:
- pgData:/var/lib/postgresql/data
ports:
- 5432:5432
deploy:
replicas: 1
networks:
- bootcamp_network
healthcheck:
test:
["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USERNAME} -d ${DB_DATABASE}'"]
interval: 10s
timeout: 3s
retries: 3
backend:
build:
context: ./backend
dockerfile: Dockerfile
env_file:
- .env
volumes:
- ./.env:/app/.env:ro
ports:
- "${PORT}:${PORT}"
networks:
- bootcamp_network
depends_on:
postgres:
condition: service_healthy
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: 3
compress: "true"
healthcheck:
test: wget --no-verbose --tries=1 --spider http://localhost:${PORT}/healthcheck || exit 1
interval: 30s
retries: 3
start_period: 20s
timeout: 30s
deploy:
replicas: 1
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
env_file:
- .env
ports:
- "3000:80"
networks:
- bootcamp_network
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: 3
compress: "true"
deploy:
replicas: 1
networks:
bootcamp_network: