-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-deploy.yaml
116 lines (107 loc) · 3.02 KB
/
docker-compose-deploy.yaml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: '3.8'
services:
redis:
container_name: redis
image: redis:alpine
app:
restart: always
volumes:
- static:/vol/web
ports:
- "8000:8000"
container_name: app
image: cr.yandex/{{ env.CR_REGISTRY }}/{{ env.CR_REPOSITORY }}:app-{{ env.IMAGE_TAG }}
environment:
- DEBUG=False
- SECRET_KEY={{env.SECRET_KEY}}
- DB_ENGINE={{env.DB_ENGINE}}
- DB_HOST=db
- DB_NAME=main_db
- DB_USER={{env.DB_USER}}
- DB_PASSWORD={{env.DB_PASSWORD}}
- DJANGO_ALLOWED_HOSTS={{env.DJANGO_ALLOWED_HOSTS}}
- CSRF_TRUSTED_ORIGINS={{env.CSRF_TRUSTED_ORIGINS}}
- AWS_S3_ACCESS_KEY_ID={{env.AWS_S3_ACCESS_KEY_ID}}
- AWS_S3_SECRET_ACCESS_KEY={{env.AWS_S3_SECRET_ACCESS_KEY}}
- GOODS_FEED_URL={{env.GOODS_FEED_URL}}
- EMAIL_HOST={{env.EMAIL_HOST}}
- EMAIL_HOST_USER={{env.EMAIL_HOST_USER}}
- EMAIL_HOST_PASSWORD={{env.EMAIL_HOST_PASSWORD}}
- MANAGERS_EMAILS={{env.MANAGERS_EMAILS}}
- DEFAULT_FROM_EMAIL={{env.DEFAULT_FROM_EMAIL}}
depends_on:
- db
- redis
db:
image: postgres:13-alpine
container_name: db
restart: always
environment:
- POSTGRES_DB=main_db
- POSTGRES_USER={{env.DB_USER}}
- POSTGRES_PASSWORD={{env.DB_PASSWORD}}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
proxy:
container_name: proxy
image: cr.yandex/{{ env.CR_REGISTRY }}/{{ env.CR_REPOSITORY }}:proxy-{{ env.IMAGE_TAG }}
restart: always
depends_on:
- app
ports:
- "80:80"
- "443:443"
volumes:
- static:/vol/web
- certbot-web:/vol/www
- proxy-dhparams:/vol/proxy
- certbot-certs:/etc/letsencrypt
environment:
- DOMAIN={{env.DOMAIN}}
certbot:
container_name: certbot
image: cr.yandex/{{ env.CR_REGISTRY }}/{{ env.CR_REPOSITORY }}:certbot-{{ env.IMAGE_TAG }}
#command: sh /opt/certify-init.sh // Only for the first run
environment:
- EMAIL={{env.ACME_DEFAULT_EMAIL}}
- DOMAIN={{env.DOMAIN}}
volumes:
- certbot-web:/vol/www
- certbot-certs:/etc/letsencrypt
depends_on:
- proxy
celeryworker:
container_name: celeryworker
image: cr.yandex/{{ env.CR_REGISTRY }}/{{ env.CR_REPOSITORY }}:app-{{ env.IMAGE_TAG }}
restart: on-failure
environment:
- BROKER_URL=${BROKER_URL}
- CELERY_BACKEND=${BROKER_URL}
- CELERY_BROKER=${BROKER_URL}
depends_on:
- app
command: 'celery -A ecomm1 worker -l DEBUG'
volumes:
- static:/vol/web
celerybeat:
container_name: celerybeat
image: cr.yandex/{{ env.CR_REGISTRY }}/{{ env.CR_REPOSITORY }}:app-{{ env.IMAGE_TAG }}
restart: on-failure
environment:
- BROKER_URL=${BROKER_URL}
- CELERY_BACKEND=${BROKER_URL}
- CELERY_BROKER=${BROKER_URL}
depends_on:
- app
- celeryworker
command: 'celery -A ecomm1 beat'
volumes:
- static:/vol/web
volumes:
postgres-data:
static:
certbot-web:
proxy-dhparams:
certbot-certs: