mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2025-11-11 17:36:04 +00:00
Added DB_IDLE_TIMEOUT and DB_MAX_LIFETIME to both production and dev Docker Compose files to complete the connection pool configuration. These variables were already documented but missing from the compose files.
117 lines
3.0 KiB
YAML
117 lines
3.0 KiB
YAML
name: patchmon-dev
|
|
|
|
services:
|
|
database:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_DB: patchmon_db
|
|
POSTGRES_USER: patchmon_user
|
|
POSTGRES_PASSWORD: 1NS3CU6E_DEV_D8_PASSW0RD
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- ./compose_dev_data/db:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U patchmon_user -d patchmon_db"]
|
|
interval: 3s
|
|
timeout: 5s
|
|
retries: 7
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
restart: unless-stopped
|
|
command: redis-server --requirepass 1NS3CU6E_DEV_R3DIS_PASSW0RD
|
|
environment:
|
|
REDIS_PASSWORD: 1NS3CU6E_DEV_R3DIS_PASSW0RD
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- ./compose_dev_data/redis:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "--no-auth-warning", "-a", "1NS3CU6E_DEV_R3DIS_PASSW0RD", "ping"]
|
|
interval: 3s
|
|
timeout: 5s
|
|
retries: 7
|
|
|
|
backend:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/backend.Dockerfile
|
|
target: development
|
|
tags: [patchmon-backend:dev]
|
|
restart: unless-stopped
|
|
environment:
|
|
NODE_ENV: development
|
|
LOG_LEVEL: info
|
|
DATABASE_URL: postgresql://patchmon_user:1NS3CU6E_DEV_D8_PASSW0RD@database:5432/patchmon_db
|
|
JWT_SECRET: INS3CURE_DEV_7WT_5ECR3T
|
|
SERVER_PROTOCOL: http
|
|
SERVER_HOST: localhost
|
|
SERVER_PORT: 3000
|
|
CORS_ORIGIN: http://localhost:3000
|
|
# Database Connection Pool Configuration (Prisma)
|
|
DB_CONNECTION_LIMIT: 30
|
|
DB_POOL_TIMEOUT: 20
|
|
DB_CONNECT_TIMEOUT: 10
|
|
DB_IDLE_TIMEOUT: 300
|
|
DB_MAX_LIFETIME: 1800
|
|
# Rate Limiting (times in milliseconds)
|
|
RATE_LIMIT_WINDOW_MS: 900000
|
|
RATE_LIMIT_MAX: 5000
|
|
AUTH_RATE_LIMIT_WINDOW_MS: 600000
|
|
AUTH_RATE_LIMIT_MAX: 500
|
|
AGENT_RATE_LIMIT_WINDOW_MS: 60000
|
|
AGENT_RATE_LIMIT_MAX: 1000
|
|
# Redis Configuration
|
|
REDIS_HOST: redis
|
|
REDIS_PORT: 6379
|
|
REDIS_PASSWORD: 1NS3CU6E_DEV_R3DIS_PASSW0RD
|
|
REDIS_DB: 0
|
|
ports:
|
|
- "3001:3001"
|
|
volumes:
|
|
- ./compose_dev_data/agents:/app/agents
|
|
depends_on:
|
|
database:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
develop:
|
|
watch:
|
|
- action: sync
|
|
path: ../backend/src
|
|
target: /app/backend/src
|
|
ignore:
|
|
- node_modules/
|
|
- action: sync
|
|
path: ../backend/prisma
|
|
target: /app/backend/prisma
|
|
- action: rebuild
|
|
path: ../backend/package.json
|
|
|
|
frontend:
|
|
build:
|
|
context: ..
|
|
dockerfile: docker/frontend.Dockerfile
|
|
target: development
|
|
tags: [patchmon-frontend:dev]
|
|
restart: unless-stopped
|
|
environment:
|
|
BACKEND_HOST: backend
|
|
BACKEND_PORT: 3001
|
|
ports:
|
|
- "3000:3000"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
develop:
|
|
watch:
|
|
- action: sync
|
|
path: ../frontend/src
|
|
target: /app/frontend/src
|
|
ignore:
|
|
- node_modules/
|
|
- action: rebuild
|
|
path: ../frontend/package.json
|