-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
72 lines (70 loc) · 2.14 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
72 lines (70 loc) · 2.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
63
64
65
66
67
68
69
70
71
72
# ========================================
# Development Overlay — Hot Reload, Bind Mounts
# ========================================
# Usage: docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d
# or: npm run dev:docker
services:
# ========================================
# Nginx — add app dependency
# ========================================
nginx:
depends_on:
app:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/api/health"]
interval: 30s
timeout: 10s
retries: 3
# ========================================
# Application — Development Mode
# ========================================
app:
build:
context: .
dockerfile: Dockerfile
target: development
container_name: cremy-docs-app
restart: unless-stopped
init: true
expose:
- "3000"
ports:
- "${APP_PORT:-3000}:3000"
environment:
NODE_ENV: development
MONGODB_URI: mongodb://${MONGO_APP_USER:-cremy-app}:${MONGO_APP_PASSWORD:-devpassword}@mongo:27017/cremy-docs?authSource=cremy-docs
REDIS_URL: redis://:${REDIS_PASSWORD:-devpassword}@redis:6379
JWT_SECRET: ${JWT_SECRET:-dev-jwt-secret}
REFRESH_SECRET: ${REFRESH_SECRET:-dev-refresh-secret}
JWT_EXPIRES_IN: 15m
REFRESH_TOKEN_EXPIRES_IN: 7d
APP_URL: http://localhost:3000
NEXT_PUBLIC_APP_URL: http://localhost:3000
NEXT_PUBLIC_API_URL: http://localhost:3000
ALLOWED_ORIGINS: http://localhost:3000,http://localhost:80
env_file:
- .env.secrets
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_healthy
networks:
- cremy-network
volumes:
- ./:/app
- /app/node_modules
- /app/.next
command: npm run dev
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"