This repository was archived by the owner on Oct 23, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
71 lines (67 loc) · 1.53 KB
/
docker-compose.yml
File metadata and controls
71 lines (67 loc) · 1.53 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
services:
db:
image: postgres:13
environment:
POSTGRES_DB: swft # Database name
POSTGRES_USER: user # Database user
POSTGRES_PASSWORD: password # Database password
volumes:
- postgres_data:/var/lib/postgresql/data
- /etc/localtime:/etc/localtime:ro
networks:
- app_network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d swft"]
interval: 10s
retries: 5
start_period: 30s
timeout: 10s
restart: always
app:
build: .
environment:
PORT: 5000
DB_HOST: db
DB_PORT: 5432
DB_NAME: swft
DB_USER: user
DB_PASSWORD: password
# Other environment variables will be read from .env file
USER_ID: "${UID}"
GROUP_ID: "${GID}"
user: "${USER_ID}:${GROUP_ID}"
env_file:
- .env
ports:
- "5000"
deploy:
replicas: 1
depends_on:
db:
condition: service_healthy
networks:
- app_network
restart: always
volumes:
- ./data:/app/data # Mount local 'data' directory to '/app/data' in container
- /etc/localtime:/etc/localtime:ro
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf # Mount Nginx configuration file
- /etc/localtime:/etc/localtime:ro
env_file:
- .env
ports:
- "${PORT}:80" # Exposing Nginx port on host
networks:
- app_network
depends_on:
- app
restart: always
volumes:
postgres_data:
driver: local
networks:
app_network:
driver: bridge