-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
91 lines (72 loc) · 1.81 KB
/
docker-compose.yml
File metadata and controls
91 lines (72 loc) · 1.81 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.simple
container_name: frontend-app
restart: unless-stopped
networks:
- app-network
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
environment:
- FRONTEND_PORT=${FRONTEND_PORT}
- API_PORT=${API_PORT}
- ENVIRONMENT=${ENVIRONMENT}
depends_on:
backend:
condition: service_healthy
backend:
build:
context: ./backend
dockerfile: Dockerfile.simple
container_name: backend-app
restart: unless-stopped
networks:
- app-network
ports:
- "${API_PORT}:${API_PORT}"
environment:
- ASPNETCORE_ENVIRONMENT=${ASPNETCORE_ENVIRONMENT}
- DB_HOST=${DB_HOST}
- DB_PORT=${DB_PORT}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- API_PORT=${API_PORT}
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://127.0.0.1:${API_PORT}/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
depends_on:
database:
condition: service_healthy
database:
image: postgres:15-alpine
container_name: postgres-db
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C"
volumes:
- db-data:/var/lib/postgres/data
networks:
- app-network
ports:
- "${DB_PORT}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
volumes:
db-data:
driver: local
networks:
app-network:
driver: bridge