-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
59 lines (55 loc) · 1.32 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
53
54
55
56
57
58
59
version: "3.9"
services:
postgres:
image: postgres:latest
container_name: postgres
volumes:
- postgres_storage:/var/lib/postgresql/data
env_file:
- .env
environment:
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d postgres"]
interval: 5s
timeout: 5s
retries: 5
ports:
- "5432:5432"
backend:
build:
dockerfile: ./Dockerfile
context: ./
container_name: backend
volumes:
- static_volume:/app/static
- media_volume:/app/media
depends_on:
postgres:
condition: service_healthy
command: >
bash -c "./manage.py collectstatic --noinput &&
./manage.py makemigrations users Resume Hackaton Score&&
./manage.py migrate &&
./manage.py initadmin &&
gunicorn -b 0.0.0.0:8000 app.wsgi:application"
nginx:
build:
dockerfile: ./Dockerfile
context: ./.docker/nginx/
container_name: nginx
volumes:
- static_volume:/app/static
- media_volume:/app/media
- /etc/letsencrypt:/etc/letsencrypt
depends_on:
- backend
ports:
- "80:80"
- "443:443"
volumes:
static_volume:
media_volume:
postgres_storage: