-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
57 lines (54 loc) · 1.2 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
57 lines (54 loc) · 1.2 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
services:
# MySQL Database
database:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: taskdb
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
timeout: 20s
retries: 10
# Express.js API
api:
build:
context: ./api
ports:
- "5000:5000"
environment:
- NODE_ENV=development
- DB_HOST=database
- DB_USER=root
- DB_PASSWORD=password
- DB_NAME=taskdb
- JWT_SECRET=your_super_secret_jwt_key_here_change_in_production
depends_on:
database:
condition: service_healthy
volumes:
- ./api:/app
- /app/node_modules
# React Frontend (Development)
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=http://localhost:5000/api
- CHOKIDAR_USEPOLLING=true
depends_on:
- api
volumes:
- ./frontend:/app
- /app/node_modules
stdin_open: true
tty: true
volumes:
mysql_data: