-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathcompose.yml
88 lines (62 loc) · 1.65 KB
/
compose.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
81
82
83
84
85
86
87
88
version: "3.8"
x-environment: &commonEnvironment
- DEBUG=${DEBUG}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- DATABASE_DB=${DATABASE_DB}
- DATABASE_USER=${DATABASE_USER}
- DATABASE_PASSWORD=${DATABASE_PASSWORD}
- DATABASE_HOST=database
- DATABASE_PORT=${DATABASE_PORT}
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_EMAIL=${ADMIN_EMAIL}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
- CELERY_BROKER=${CELERY_BROKER}
- SECRET_KEY=${SECRET_KEY}
- EMAIL_HOST=${EMAIL_HOST}
- EMAIL_USE_TLS=${EMAIL_USE_TLS}
- EMAIL_PORT=${EMAIL_PORT}
- EMAIL_USE_SSL=${EMAIL_USE_SSL}
- EMAIL_HOST_USER=${EMAIL_HOST_USER}
- EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD}
- EMAIL_SENDER=${EMAIL_SENDER}
services:
application:
build: .
ports:
- 80:8000
depends_on:
database:
condition: service_healthy
environment: *commonEnvironment
command: gunicorn --bind 0.0.0.0:8000 --workers ${WORKERS} CMS.wsgi
celery:
build: .
depends_on:
- application
- redis
command: celery --app=CMS worker --loglevel=info
environment: *commonEnvironment
redis:
image: redis:7-alpine
restart: always
database:
image: postgres:alpine
restart: always
expose:
- 5432
environment:
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_DB}
healthcheck:
test: ["CMD", "pg_isready",'-U${DATABASE_USER}', '-d${DATABASE_DB}']
interval: 10s
timeout: 5s
retries: 5
volumes:
- type: volume
source: pgdata
target: /var/lib/postgresql/data
volumes:
pgdata:
driver: local