-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
46 lines (42 loc) · 1.04 KB
/
docker-compose.yml
File metadata and controls
46 lines (42 loc) · 1.04 KB
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
version: '3'
services:
db:
image: postgres
volumes:
- /var/lib/postgresql/10/main:/var/lib/postgresql/data
environment:
- POSTGRES_DB=test1
- POSTGRES_USER=projectuser
- POSTGRES_PASSWORD=password
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
django:
build:
context: .
dockerfile: ./Dockerfile
environment:
- DJANGO_DEBUG=True
- DJANGO_DB_HOST=db
- DJANGO_DB_PORT=5432
- DJANGO_DB_NAME=test1
- DJANGO_DB_USERNAME=projectuser
- DJANGO_DB_PASSWORD=password
- DJANGO_SECRET_KEY=dev_secret_key
ports:
- "8000:8000"
command:
- python3 manage.py runserver 0:8000
volumes:
- ./:/phopo/
docker run -it --rm \
-p 8000:8000 \
--link db \
-e DJANGO_DB_HOST=db \
-e DJANGO_DEBUG=True \
project \
./manage.py makemigrations ./manage.py migrate ./manage.py runserver 0:8000
docker run --rm \
--name db \
-e POSTGRES_DB=test1 \
-e POSTGRES_USER=projectuser \
-e POSTGRES_PASSWORD=password \
postgres