-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.prod.yaml
57 lines (55 loc) · 1.5 KB
/
docker-compose.prod.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
version: "3.8"
services:
web:
build:
context: ./app
dockerfile: Dockerfile.prod
command: gunicorn ce_tour.wsgi:application --bind 0.0.0.0:8000
volumes:
- static_volume:/home/app/web/staticfiles
environment:
- SECRET_KEY=${SECRET_KEY}
- SQL_ENGINE=${SQL_ENGINE}
- SQL_DATABASE=${SQL_DATABASE}
- SQL_USER=${SQL_USER}
- SQL_PASSWORD=${SQL_PASSWORD}
- SQL_HOST=${SQL_HOST}
- SQL_PORT=${SQL_PORT}
- DATABASE=${DATABASE}
- GS_CREDENTIALS=${GS_CREDENTIALS}
- GS_PROJECT_ID=${GS_PROJECT_ID}
- GS_BUCKET_NAME=${GS_BUCKET_NAME}
expose:
- 8000
depends_on:
- db
db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
nginx:
image: nginx
restart: unless-stopped
volumes:
- static_volume:/home/app/web/staticfiles
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./certbot/conf:/etc/letsencrypt/:ro
- ./certbot/www:/var/www/certbot/:ro
ports:
- 80:80
- 443:443
depends_on:
- web
certbot:
image: certbot/certbot
volumes:
- ./certbot/conf/:/etc/letsencrypt/:rw
- ./certbot/www/:/var/www/certbot/:rw
command: certonly --webroot -w /var/www/certbot --keep-until-expiring --email ${CERTBOT_EMAIL} -d ${CERTBOT_DOMAIN} --agree-tos -v
volumes:
postgres_data:
static_volume: