mirror of
https://github.com/bitbaum/datacat.git
synced 2026-12-04 04:27:33 +01:00
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com> Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
132 lines
3.3 KiB
YAML
132 lines
3.3 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
# PostgreSQL Database
|
|
postgres:
|
|
image: postgres:15-alpine
|
|
container_name: formular-postgres
|
|
environment:
|
|
POSTGRES_DB: formbuilder
|
|
POSTGRES_USER: formbuilder
|
|
POSTGRES_PASSWORD: devpassword
|
|
POSTGRES_INITDB_ARGS: '--encoding=UTF-8 --lc-collate=C --lc-ctype=C'
|
|
ports:
|
|
- '5433:5432'
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
networks:
|
|
- formular-network
|
|
healthcheck:
|
|
test: ['CMD-SHELL', 'pg_isready -U formbuilder -d formbuilder']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Redis for caching and job queues
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: formular-redis
|
|
ports:
|
|
- '6380:6379'
|
|
volumes:
|
|
- redis_data:/data
|
|
networks:
|
|
- formular-network
|
|
healthcheck:
|
|
test: ['CMD', 'redis-cli', 'ping']
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
# Backend API Service
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.backend
|
|
container_name: formular-backend
|
|
environment:
|
|
NODE_ENV: development
|
|
PORT: 5001
|
|
DB_HOST: postgres
|
|
DB_PORT: 5432
|
|
DB_DATABASE: formbuilder
|
|
DB_USER: formbuilder
|
|
DB_PASSWORD: devpassword
|
|
REDIS_URL: redis://redis:6379
|
|
JWT_SECRET: your-super-secret-jwt-key-change-in-production
|
|
DATABASE_URL: postgresql://formbuilder:devpassword@postgres:5432/formbuilder
|
|
ports:
|
|
- '5001:5001'
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
networks:
|
|
- formular-network
|
|
volumes:
|
|
- ./backend:/app/backend:ro
|
|
- backend_node_modules:/app/backend/node_modules
|
|
command: ['pnpm', 'run', 'dev:backend']
|
|
healthcheck:
|
|
test: ['CMD', 'curl', '-f', 'http://localhost:5001/health']
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Frontend Next.js Service
|
|
frontend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.frontend
|
|
container_name: formular-frontend
|
|
environment:
|
|
NODE_ENV: development
|
|
NEXT_PUBLIC_API_URL: http://localhost:5001
|
|
NEXT_PUBLIC_BRAND_PRESET: generic
|
|
# Must match the backend service's JWT_SECRET below — the frontend signs the
|
|
# session token that the real Express backend verifies on data-ingestion routes.
|
|
JWT_SECRET: your-super-secret-jwt-key-change-in-production
|
|
ports:
|
|
- '3000:3000'
|
|
depends_on:
|
|
- backend
|
|
networks:
|
|
- formular-network
|
|
volumes:
|
|
- ./frontend:/app/frontend:ro
|
|
- frontend_node_modules:/app/frontend/node_modules
|
|
- ./frontend/.next:/app/frontend/.next
|
|
command: ['pnpm', 'run', 'dev:frontend']
|
|
|
|
# Database Migration Service (runs once)
|
|
migrate:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.backend
|
|
container_name: formular-migrate
|
|
environment:
|
|
DATABASE_URL: postgresql://formbuilder:devpassword@postgres:5432/formbuilder
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
networks:
|
|
- formular-network
|
|
command: ['npx', 'prisma', 'migrate', 'deploy']
|
|
profiles:
|
|
- migrate
|
|
|
|
volumes:
|
|
postgres_data:
|
|
driver: local
|
|
redis_data:
|
|
driver: local
|
|
backend_node_modules:
|
|
driver: local
|
|
frontend_node_modules:
|
|
driver: local
|
|
|
|
networks:
|
|
formular-network:
|
|
driver: bridge
|