-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
43 lines (42 loc) · 1017 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
40
41
42
43
version: "3.9"
services:
front:
build: front/.
volumes:
- ./front/src:/app/src
ports:
- 3000:3000
web:
build: api/.
working_dir: /usr/src/app
command: >
bash -c "
./wait-for-postgres.sh db &&
(git clone https://github.com/rlopez0689/MyProducts.git /usr/src/repo/MyProducts || true) &&
python manage.py migrate && python manage.py runserver 0.0.0.0:8000
"
volumes:
- ./api:/usr/src/app/
- ./repo:/usr/src/repo
ports:
- "8000:8000"
environment:
- DB_NAME=mygit
- DB_USER=postgres
- DB_PASSWORD=postgres
- DB_HOST=db
- DB_PORT=5432
- REPO_PATH=/usr/src/repo/MyProducts
depends_on:
- db
db:
image: postgres
volumes:
- ./data/db:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
environment:
- POSTGRES_NAME=mygit
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres