forked from raccoonyy/django-sample-for-docker-compose
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
44 lines (41 loc) · 939 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
version: '3'
volumes:
django_sample_db_dev: {}
services:
db:
image: postgres
volumes:
- django_sample_db_dev:/var/lib/postgresql/data
environment:
- POSTGRES_DB=sampledb
- POSTGRES_USER=sampleuser
- POSTGRES_PASSWORD=samplesecret
django:
build:
context: .
dockerfile: ./compose/django/Dockerfile-dev
environment:
- DJANGO_DEBUG=True
- DJANGO_DB_HOST=postgres
- DJANGO_DB_PORT=5432
- DJANGO_DB_NAME=sampledb
- DJANGO_DB_USERNAME=sampleuser
- DJANGO_DB_PASSWORD=samplesecret
- DJANGO_SECRET_KEY=dev_secret_key
ports:
- "8000:8000"
depends_on:
- db
links:
- db:postgres
command:
- bash
- -c
- |
/wait-for-it.sh postgres:5432 -t 10
python manage.py migrate
python manage.py runserver 0:8000
# stdin_open: true
# tty: true
volumes:
- ./:/app/