-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
83 lines (78 loc) · 1.92 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
82
83
version: '3.8'
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- BUILD_ENV=${BUILD_ENV:-production}
ports:
- "${FRONTEND_PORT:-8080}:8080"
environment:
- VITE_ENV=${VITE_ENV:-production}
- VITE_CORE_API_URL=${VITE_CORE_API_URL:-http://backend:8000/v3}
networks:
- app-network
depends_on:
- backend
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080"]
interval: 30s
timeout: 10s
retries: 3
backend:
build:
context: ./backend
dockerfile: Dockerfile
ports:
- "${BACKEND_PORT:-8000}:8000"
environment:
- DB_HOST=${DB_HOST:-db}
- DB_USERNAME=${DB_USERNAME:-postgres}
- DB_PASSWORD=${DB_PASSWORD}
- DB_PORT=${DB_PORT:-5432}
- DB_DIALECT=${DB_DIALECT:-postgresql}
- DB_NAME=${DB_NAME:-postgres}
- ENV=${ENV:-production}
depends_on:
db:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
- db-network
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/v3/system/up"]
interval: 30s
timeout: 10s
retries: 3
db:
build:
context: ./postgres
dockerfile: Dockerfile
ports:
- "${DB_PORT:-5432}:5432"
environment:
- POSTGRES_USER=${DB_USERNAME:-postgres}
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_DB=${DB_NAME:-postgres}
- POSTGRES_HOST_AUTH_METHOD=${POSTGRES_HOST_AUTH_METHOD:-trust}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- db-network
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
app-network:
driver: bridge
db-network:
driver: bridge
volumes:
postgres_data:
driver: local