Newer
Older
version: '3'
services:
postgres:
image: postgres:13
restart: always
environment:
POSTGRES_DB: smash
POSTGRES_USER: runner
POSTGRES_PASSWORD: password
ports:
- "5432:5432"
web:
build: .
expose:
- '8002'
entrypoint: bash -c "sleep 5
&& python manage.py makemigrations web
&& python manage.py migrate
&& python manage.py migrate sessions
&& python manage.py collectstatic --noinput
&& python manage.py test -v3"
# && python manage.py runserver 0.0.0.0:8002 --verbosity 3"
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
# && gunicorn -b 0.0.0.0:8002 smash.wsgi:application --access-logfile access.log --error-logfile error.log"
# && python manage.py runserver 0.0.0.0:8002 --verbosity 3
command: ""
ports:
- "8002:8002"
volumes:
- static_files:/static/
depends_on:
- postgres
nginx:
command:
- nginx-debug
- "-g"
- "daemon off;"
image: "nginx:alpine"
ports:
- "80:80"
- "443:443"
- "8080:8080"
expose:
- "80"
- "443"
- "8080"
depends_on:
- web
- postgres
volumes:
- "./docker/nginx/nginx.conf:/etc/nginx/nginx.conf"
- "./docker/nginx/nginx-selfsigned.crt:/etc/ssl/certs/nginx-selfsigned.crt"
- "./docker/nginx/nginx-selfsigned.key:/etc/ssl/private/nginx-selfsigned.key"
- "./docker/nginx/dhparam.pem:/etc/ssl/certs/dhparam.pem"
- "./docker/nginx/smasch.conf:/etc/nginx/conf.d/smasch.conf"
- static_files:/var/www/shared/static/
- nginx_logs:/log
volumes:
static_files:
nginx_logs: