-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
39 lines (36 loc) · 957 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
services:
web:
image: devchem/octo:bookstore_v0.1.0
ports:
- "3004:3004"
environment:
- VITE_BOOK_API_URL=http://localhost:8000
api:
image: devchem/octo:bookapi_v1.0.0
ports:
- "8000:8000"
# This volume is used for hot reloading
volumes:
- ./app:/app
command: >
sh -c "python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
environment:
- DB_HOST=${DB_HOST}
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASSWORD=${DB_PASSWORD}
- DJANGO_SECRET_KEY=${DJANGO_SECRET_KEY}
depends_on:
- db
user: "user" # Run the app service as the non-root user
db:
image: postgres:13-alpine
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data/
volumes:
postgres_data: