-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
67 lines (65 loc) · 1.72 KB
/
Copy pathdocker-compose.prod.yaml
File metadata and controls
67 lines (65 loc) · 1.72 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
services:
db:
image: postgis/postgis:16-3.4
restart: always
platform: linux/amd64
container_name: bluepages_db
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASSWORD}
DB_PORT: ${DB_PORT}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db_dump.sql:/tmp/db_dump.sql:ro
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME} -h localhost -p ${DB_PORT}"]
interval: 10s
timeout: 5s
retries: 5
web:
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
container_name: bluepages_web
command: ["prod"]
image: ${BLUEPAGES_GHCR_PATH}:latest
volumes:
- static_volume:/app/bluepages/static_root
- media_volume:/app/bluepages/media_root
env_file:
- path: .env.prod
required: true
healthcheck:
test: ["CMD-SHELL", "python manage.py check --deploy 2>/dev/null || python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/\")' 2>/dev/null"]
interval: 15s
timeout: 10s
retries: 5
start_period: 30s
depends_on:
db:
condition: service_healthy
proxy:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
env_file:
- path: .env.prod
required: true
volumes:
- static_volume:/app/static_root
- media_volume:/app/media_root
- ./nginx.conf:/etc/nginx/conf.d/default.conf
- /etc/letsencrypt:/etc/letsencrypt:ro
depends_on:
- web
volumes:
postgres_data:
static_volume:
media_volume: