-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (54 loc) · 1.75 KB
/
docker-compose.yml
File metadata and controls
59 lines (54 loc) · 1.75 KB
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
version: '3.9'
services:
postgres:
image: postgres:14-alpine
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
volumes:
- pgdata:/var/lib/postgresql/data/
networks:
- main
django:
build: .
#
# By default, we are proxying from Nginx directly to Uvicorn. If you would like to use Gunicorn instead,
# comment out the line below and uncomment the appropriate Gunicorn command.
#
command: uvicorn --app-dir /code/django config.asgi:application --host 0.0.0.0 --port 8001 --lifespan=off --reload-dir /code/django --reload
#
# This command will use Gunicorn as the process manager for Uvicorn with four worker processes.
# You will need to add Gunicorn to the requirements.text file.
#
#command: gunicorn --pythonpath '/code/django' config.asgi:application -w 4 -b :8001 -k uvicorn.workers.UvicornWorker --reload
#
# This command will proxy fron Nginx directly to Gunicorn; this is the traditional, synchronous
# approach for WSGI deployments. You will need to add Gunicorn to the requirements.txt file.
#
#command: gunicorn --pythonpath '/code/django' config.wsgi:application -w 4 -b :8001 --reload
volumes:
- ./django:/code/django/
networks:
- main
tty: true
depends_on:
- postgres
nginx:
image: nginx:1.21-alpine
env_file: ./nginx.env
volumes:
- ./django/static:/usr/share/nginx/django/static
- ./django/resources:/usr/share/nginx/django/resources
- ./${NGINX_CONF}:/etc/nginx/templates
- ${LOCAL_CERTS_PATH}:${NGINX_CERTS_PATH}
ports:
- 8000:80
- 8443:443
networks:
- main
depends_on:
- django
volumes:
pgdata:
networks:
main: