-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
41 lines (37 loc) · 1023 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
41 lines (37 loc) · 1023 Bytes
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
services:
web:
build: .
command: >
sh -c "python manage.py wait_for_db &&
python manage.py migrate &&
python manage.py runserver 0.0.0.0:5001"
ports:
- "5001:5001"
expose:
- 5001
environment:
- DEBUG=1
- DB_NAME=mydatabase
- DB_USER=myuser
- DB_PASSWORD=mypassword
- DB_HOST=db # The postgres service is db which app connects over localhost (network bridge)
- DB_PORT=5432
- ALLOWED_HOSTS=localhost,127.0.0.1,0.0.0.0
- CSRF_TRUSTED_ORIGINS=http://localhost:5001/, http://127.0.0.1:5001/
depends_on:
- db
db:
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
# - ./init.sql:/docker-entrypoint-initdb.d/init.sql # To run additional commands, generally not required
ports:
- "5432:5432"
expose:
- 5432
environment:
POSTGRES_DB: mydatabase
POSTGRES_USER: myuser
POSTGRES_PASSWORD: mypassword
volumes:
postgres_data: