generated from High10Hunter/drf-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
53 lines (46 loc) · 975 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
44
45
46
47
48
49
50
51
52
53
version: '3.8'
networks:
app-network:
driver: bridge
services:
db:
image: postgres:14.2
container_name: postgres-db
ports:
- 5432:5432
environment:
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- db-data:/data/postgres
networks:
- app-network
init_dev:
build:
context: .
ports:
- 8000:80
environment:
DB_HOST: postgres-db
DB_NAME: ${DB_NAME}
DB_USERNAME: ${DB_USERNAME}
DB_PASSWORD: ${DB_PASSWORD}
env_file:
- .env
depends_on:
- db
volumes:
- ./scripts/wait-for-it.sh:/code/scripts/wait-for-it.sh
command: [
'/bin/sh',
'-c',
'chmod +x /code/scripts/wait-for-it.sh && /code/scripts/wait-for-it.sh postgres-db:5432 --timeout=30',
]
entrypoint: [
./docker-entrypoint.sh
]
networks:
- app-network
volumes:
db-data: