forked from mljar/mercury
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-https.yml
78 lines (75 loc) · 2.62 KB
/
docker-compose-https.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
version: '2'
services:
nginx:
restart: unless-stopped
build:
context: .
dockerfile: ./docker/nginx/Dockerfile
ports:
- 80:80
- 443:443
volumes:
- static_volume:/app/mercury/django_static
- media_volume:/app/mercury/media
- ./docker/nginx/pro:/etc/nginx/conf.d
- ./docker/nginx/certbot/conf:/etc/letsencrypt
- ./docker/nginx/certbot/www:/var/www/certbot
depends_on:
- mercury
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
image: certbot/certbot
restart: unless-stopped
volumes:
- ./docker/nginx/certbot/conf:/etc/letsencrypt
- ./docker/nginx/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
mercury:
restart: unless-stopped
build:
context: .
dockerfile: ./docker/mercury/Dockerfile
args:
GITHUB_TOKEN: ${GITHUB_TOKEN}
entrypoint: /app/docker/mercury/entrypoint.sh
volumes:
- ${NOTEBOOKS_PATH}:/app/notebooks
- static_volume:/app/mercury/django_static
- media_volume:/app/mercury/media
expose:
- 9000
environment:
DEBUG: ${DEBUG}
SERVE_STATIC: ${SERVE_STATIC}
DJANGO_SUPERUSER_USERNAME: ${DJANGO_SUPERUSER_USERNAME}
DJANGO_SUPERUSER_PASSWORD: ${DJANGO_SUPERUSER_PASSWORD}
DJANGO_SUPERUSER_EMAIL: ${DJANGO_SUPERUSER_EMAIL}
SECRET_KEY: ${SECRET_KEY}
ALLOWED_HOSTS: ${ALLOWED_HOSTS}
WELCOME: ${WELCOME}
EMAIL_HOST: ${EMAIL_HOST}
EMAIL_HOST_USER: ${EMAIL_HOST_USER}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
EMAIL_PORT: ${EMAIL_PORT}
DEFAULT_FROM_EMAIL: ${DEFAULT_FROM_EMAIL}
DJANGO_DB: postgresql
POSTGRES_HOST: db
POSTGRES_NAME: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_PORT: 5432
depends_on:
- db
db:
image: postgres:13.0-alpine
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
static_volume: {}
media_volume: {}
postgres_data: {}