-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
31 lines (26 loc) · 1008 Bytes
/
docker-compose.yaml
File metadata and controls
31 lines (26 loc) · 1008 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
version: "3.9"
services:
db:
image: postgres
volumes:
- pgdata:/var/lib/postgresql/data # Volume to keep data alive even if the container is killed.
environment: # Have to set the below environment variables when using postgres database.
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
file_converter_app:
build:
context: ./
dockerfile: file_converter_app.Dockerfile
command: > # Making sure that the inside the container the app runs on 8000th port.
bash -c "python manage.py makemigrations
&& python manage.py migrate
&& python manage.py runserver 0.0.0.0:8000"
volumes:
- .:/code
ports: # Exposing the 8000th port to the local machine's 8000th port.
- "8000:8000"
depends_on: # Since, this image depends on the postgres image defined and configured above.
- db
volumes: # Mentioning all the volumes of this particular docker-compose.yaml file
pgdata: