-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.deployment.yml
80 lines (71 loc) · 1.67 KB
/
docker-compose.deployment.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
# Config for deployment (tst/acc/prd)
services:
_django-image_build:
image: django-deployment-image
env_file:
- ./.env.django
user: '${UID}:${GID}'
build:
context: ./src/backend
dockerfile: Dockerfile.deployment
args:
- UID=${UID}
- GID=${GID}
command: [ 'echo', 'build completed' ] # any linux command which directly terminates.
django:
image: django-deployment-image
extends:
file: common-services.yml
service: django
command: gunicorn wsgi:application --bind 0.0.0.0:8000
restart: unless-stopped
depends_on:
- _django-image_build
- postgres
- rabbitmq
ports:
- ${DJANGO_HTTP_PORT:-8000}:8000
volumes:
- ./data/staticfiles:/home/app/staticfiles
- ./data/mediafiles:/home/app/mediafiles
django-dramatiq-worker:
image: django-deployment-image
extends:
file: common-services.yml
service: django-dramatiq-worker
restart: unless-stopped
depends_on:
- postgres
- _django-image_build
- rabbitmq
postgres:
extends:
file: common-services.yml
service: postgres
restart: unless-stopped
pg-backups:
extends:
file: common-services.yml
service: pg-backups
links:
- postgres
depends_on:
- postgres
environment:
POSTGRES_HOST: postgres
BACKUP_KEEP_DAYS: 7
BACKUP_KEEP_WEEKS: 2
BACKUP_KEEP_MONTHS: 1
rabbitmq:
hostname: rabbitmq
extends:
file: common-services.yml
service: rabbitmq
restart: unless-stopped
ulimits:
nofile:
soft: 65536
hard: 65536
volumes:
postgres_data:
rabbitmq_data: