-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
66 lines (58 loc) · 1.73 KB
/
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: '3'
services:
#> docker-compose exec db psql --username=postgres_user --dbname=django_react
db:
image: postgres:14
container_name: django-react-db
command: postgres -c config_file=/etc/postgresql/postgresql.conf
ports:
- "${SQL_PORT}:5432"
volumes:
- ./postgres/conf:/etc/postgresql
- ./postgres/data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${SQL_DATABASE}
- POSTGRES_USER=${SQL_USER}
- POSTGRES_PASSWORD=${SQL_PASS}
restart: always
#> docker-compose exec api bash
api:
build: ./django/.
container_name: django-react-api
command: python manage.py runserver 0.0.0.0:8000
#command: gunicorn main.wsgi:application --bind 0.0.0.0:8000
env_file: .env
ports:
- "${API_PORT}:8000"
volumes:
- ./django:/app
depends_on:
- db
restart: on-failure
#> docker-compose exec web bash
web:
build: ./react/.
container_name: django-react-web
command: npm start
env_file: .env
ports:
- "${WEB_PORT}:3000"
volumes:
- ./react:/app
depends_on:
- api
restart: on-failure
#> docker-compose exec test bash
# test:
# image: python:3
# container_name: django-react-test
# tty: true
# upgrades ???
# api:
# command: >
# sh -c " python manage.py migrate &&
# gunicorn restaurant.wsgi:application --bind 0.0.0.0:8000"
# web:
# volumes:
# - ./frontend:/app/frontend
# - node-modules:/app/frontend/node_modules