-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
62 lines (55 loc) · 1.14 KB
/
docker-compose.yml
File metadata and controls
62 lines (55 loc) · 1.14 KB
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
version: '3.9'
services:
db:
image: mysql:8.0
container_name: mysql_db
restart: always
env_file:
- ./backend/shop/.env
environment:
MYSQL_DATABASE: ${DB_NAME}
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
redis:
image: redis:7
container_name: redis
restart: always
ports:
- "6379:6379"
backend:
build:
context: ./backend/shop
dockerfile: Dockerfile
container_name: backend
command: >
sh -c "./wait-for-it.sh db:3306 -- python manage.py migrate &&
python manage.py runserver 0.0.0.0:8000"
env_file:
- ./backend/shop/.env
volumes:
- ./backend/shop:/app
ports:
- "8000:8000"
depends_on:
- db
- redis
frontend:
build:
context: ./frontend/shop
dockerfile: Dockerfile
container_name: frontend
ports:
- "3000:3000"
environment:
API_URL: http://backend:8000
volumes:
- ./frontend/shop:/app
command: >
sh -c "npm install && npm run dev"
depends_on:
- backend
volumes:
db_data: