-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
43 lines (42 loc) · 943 Bytes
/
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
version: "3.7"
services:
db:
image: postgres:latest
restart: always
env_file:
- .env
environment:
- POSTGRES_USER=${DATABASE_USER}
- POSTGRES_PASSWORD=${DATABASE_PASSWORD}
- POSTGRES_DB=${DATABASE_NAME}
volumes:
- db_data:/var/lib/postgresql/data/
ports:
- ${DATABASE_PORT}:5432
redis:
image: redis
restart: always
env_file:
- .env
ports:
- ${REDIS_PORT}:6379
volumes:
- redis_data:/data
app:
build:
context: .
dockerfile: Dockerfile
restart: on-failure
env_file:
- .env
command: bash -c "chmod +x ./wait-for-it.sh && ./wait-for-it.sh db:${DATABASE_PORT} && python3 manage.py makemigrations && python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports:
- ${APP_PORT}:8000
depends_on:
- db
- redis
volumes:
redis_data:
db_data: