-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
65 lines (63 loc) · 2.09 KB
/
docker-compose.dev.yml
File metadata and controls
65 lines (63 loc) · 2.09 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
# Development environment with hot reload
# Usage: docker compose -f docker-compose.yml -f docker-compose.dev.yml up
services:
# Backend Service (NestJS) - Development mode
backend:
build:
context: ./src/backend
dockerfile: Dockerfile
target: development
container_name: smart-erp-backend-dev
environment:
NODE_ENV: development
PORT: 3000
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: ${POSTGRES_DB:-erp_production}
DB_USER: ${POSTGRES_USER:-postgres}
DB_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
REDIS_HOST: redis
REDIS_PORT: 6379
JWT_SECRET: ${JWT_SECRET:-dev-secret-key-change-in-production}
JWT_EXPIRES_IN: ${JWT_EXPIRES_IN:-15m}
REFRESH_TOKEN_EXPIRES_IN: ${REFRESH_TOKEN_EXPIRES_IN:-7d}
CORS_ORIGIN: ${CORS_ORIGIN:-http://localhost:5173}
ports:
- '${BACKEND_PORT:-3000}:3000'
- '9229:9229' # Debug port
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
volumes:
- ./src/backend/src:/app/src:ro # Hot reload
- /app/node_modules # Protect container's node_modules
networks:
- smart-erp-network
restart: unless-stopped
# Frontend Service (React) - Development mode
frontend:
build:
context: ./src/frontend
dockerfile: Dockerfile
target: development
container_name: smart-erp-frontend-dev
environment:
VITE_PORT: ${VITE_PORT:-5173}
PORT: ${VITE_PORT:-5173}
VITE_API_URL: ${VITE_API_URL:-http://localhost:3000/api}
VITE_WS_URL: ${VITE_WS_URL:-ws://localhost:3000}
ports:
- '${FRONTEND_PORT:-5173}:${VITE_PORT:-5173}'
depends_on:
- backend
volumes:
- ./src/frontend/src:/app/src:ro # Hot reload
- ./src/frontend/public:/app/public:ro
- ./src/frontend/vite.config.ts:/app/vite.config.ts:ro # Mount vite config
- ./src/frontend/tsconfig.json:/app/tsconfig.json:ro # Mount tsconfig
- /app/node_modules # Protect container's node_modules
networks:
- smart-erp-network
restart: unless-stopped