-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (39 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
version: "3"
services:
app:
build:
context: .
# map host - to image port
ports:
- "8000:8000"
volumes:
# map volumes
- ./app:/app
# run shell
# run django development server on all ip addresses on port 8000 ( mapped tp local machine)
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
environment:
- DB_HOST=db
- DB_NAME=app
- DB_USER=postgres
- DB_PASS=supersecretpassword
depends_on:
- db
db:
image: postgres:10-alpine
environment:
- POSTGRES_DB=app
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=supersecretpassword
# ports:
# - "5432:5432"
# in prodction add a encryped env var that overwrites this
# when pushing
# get the core 26.
# docker-compose run app sh -c "python manage.py startapp core"
# docker-compose run app sh -c "python manage.py makemigrations core"
# docker-compose run app sh -c "python manage.py migrate core"
# sudo pkill -u postgres