-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.prod.yml
More file actions
67 lines (61 loc) · 1.58 KB
/
compose.prod.yml
File metadata and controls
67 lines (61 loc) · 1.58 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
x-common-backend: &common-backend
image: ${COMPOSE_DOCKER_IMAGE}
user: 1000:1000
networks:
- traefik
- bridge
env_file: .env
services:
backend:
<<: *common-backend
restart: always
depends_on:
- postgres
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.flashcard_workshop.entrypoints=websecure"
- "traefik.http.routers.flashcard_workshop.rule=Host(`${COMPOSE_DOMAIN_NAME}`)"
- "traefik.http.services.flashcard_workshop.loadbalancer.server.port=8010"
- "traefik.http.routers.flashcard_workshop.tls=true"
ports:
- "8010:8010"
volumes:
- traefik_shared_static_files:/app/public
command: "gunicorn flashcard_workshop.wsgi -w 4 -b 0.0.0.0:8010"
postgres:
image: postgres:17
container_name: flashcard_postgres
restart: on-failure
networks:
- bridge
volumes:
- postgres_data:/var/lib/postgresql/data
env_file: .env
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
interval: 1s
retries: 20
migrations:
<<: *common-backend
restart: "no"
depends_on:
- postgres
command: "python manage.py migrate"
collectstatic:
<<: *common-backend
restart: "no"
command: "python manage.py collectstatic --no-input"
volumes:
- traefik_shared_static_files:/app/public
depends_on:
- backend
volumes:
static_files:
traefik_shared_static_files:
external: true
postgres_data:
networks:
traefik:
external: true
bridge: