-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (47 loc) · 1.08 KB
/
docker-compose.yml
File metadata and controls
51 lines (47 loc) · 1.08 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
version: "3.9"
services:
frontend:
image: node:22
working_dir: /app
volumes:
- ./client:/app
- /app/node_modules
ports:
- "5173:5173"
command: sh -c "npm install && npm run dev -- --host --port 5173"
environment:
- CHOKIDAR_USEPOLLING=true
depends_on:
- db
backend:
image: node:22
working_dir: /app
volumes:
- ./server:/app
- /app/node_modules
ports:
- "3000:3000"
command: sh -c "npm install && npm run dev"
env_file:
- ./.env # put your DB creds here
environment:
- CHOKIDAR_USEPOLLING=true
depends_on:
- db
db:
image: mysql:8
container_name: smartgrocer-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: devpass
MYSQL_DATABASE: smartgrocer
MYSQL_USER: appuser
MYSQL_PASSWORD: apppass
ports:
- "3306:3306"
volumes:
- db_data:/var/lib/mysql
# optional seed: create ./db/seed.sql and uncomment next line
- ./db/seed.sql:/docker-entrypoint-initdb.d/seed.sql:ro
volumes:
db_data: