-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
37 lines (33 loc) · 992 Bytes
/
docker-compose.yaml
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
version: "3.9"
services:
database:
image: "postgres:14-alpine"
ports:
- "5432:5432"
volumes:
- dbdata:/var/lib/postgresql/data
env_file:
.env
app:
build:
context: ./
dockerfile: Dockerfile.dev
# set all this commands because when I use `./scripts.sh prestart` it
# thorws a permission error cos I am using volumes share the code inside the container
command: >
bash -c "alembic upgrade head
&& python manage.py core create-default-scopes
&& python manage.py core create-superuser
&& python manage.py universities insert-initial-data
&& uvicorn app.main:app --port 8000 --reload --proxy-headers --host 0.0.0.0"
depends_on:
- database
ports:
- "8000:8000"
# TODO run `docker-compose up` and fix error of permissions for run `./scripts.sh` dev inside the container when there is a volume
volumes:
- .:/code:rw
env_file:
- .env
volumes:
dbdata: