-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
87 lines (81 loc) · 1.88 KB
/
docker-compose.yml
File metadata and controls
87 lines (81 loc) · 1.88 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# docker-compose.yml
version: "3.9"
services:
db:
image: mysql:8.0
container_name: nextshopsphere_db_dev
restart: unless-stopped
environment:
MYSQL_DATABASE: nextshopsphere
MYSQL_USER: admin
MYSQL_PASSWORD: admin123
MYSQL_ROOT_PASSWORD: root123
ports:
- "3307:3306"
volumes:
- mysql_data_dev:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot123"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- app_network
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: nextshopsphere_backend_dev
command: >
sh -c "
echo 'Waiting for MySQL...' &&
sleep 15 &&
python manage.py migrate --noinput &&
python manage.py runserver 0.0.0.0:8000
"
volumes:
- ./backend:/app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
env_file:
- ./backend/.env
environment:
DB_HOST: db
DB_NAME: nextshopsphere
DB_USER: admin
DB_PASSWORD: admin123
DB_PORT: 3306
DEBUG: "True"
SECRET_KEY: dev-secret-key-not-for-production
ALLOWED_HOSTS: localhost,127.0.0.1,backend
CORS_ALLOWED_ORIGINS: http://localhost:3000,http://127.0.0.1:3000
networks:
- app_network
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: nextshopsphere_frontend_dev
ports:
- "3000:3000"
volumes:
- ./frontend:/app
- /app/node_modules
env_file:
- ./frontend/.env
environment:
- REACT_APP_API_URL=http://localhost:8000/api
- WATCHPACK_POLLING=true
depends_on:
- backend
networks:
- app_network
volumes:
mysql_data_dev:
networks:
app_network:
driver: bridge