-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
52 lines (48 loc) · 1.08 KB
/
docker-compose.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
version: "3.9"
services:
db:
image: postgres:latest
container_name: db
volumes:
- postgres_storage:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
web:
build:
dockerfile: ./Dockerfile
context: ./
container_name: web
depends_on:
- db
volumes:
- static_volume:/project/static
- media_volume:/project/media
env_file:
- ./.env
command: >
bash -c "./manage.py collectstatic --noinput &&
./manage.py makemigrations &&
./manage.py migrate &&
./manage.py initadmin &&
gunicorn -b 0.0.0.0:8000 project.wsgi:application"
nginx:
build:
dockerfile: ./Dockerfile
context: ./docker/nginx/
container_name: nginx
env_file:
- ./.env
volumes:
- static_volume:/project/static
- media_volume:/project/media
depends_on:
- web
ports:
- "80:80"
- "443:443""
volumes:
static_volume:
media_volume:
postgres_storage: