57 lines
1.4 KiB
YAML
57 lines
1.4 KiB
YAML
version: "3.8"
|
|
|
|
services:
|
|
# ─── Backend API + WebSocket Server ───
|
|
inknote-server:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: inknote-server
|
|
restart: unless-stopped
|
|
ports:
|
|
- "4000:4000"
|
|
environment:
|
|
- PORT=4000
|
|
- JWT_SECRET=${JWT_SECRET:-please-change-this-secret-key}
|
|
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
|
|
- NODE_ENV=production
|
|
volumes:
|
|
- inknote-data:/app/data
|
|
- inknote-uploads:/app/uploads
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:4000/api/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
# ─── Frontend (Production Build) ───
|
|
inknote-web:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: inknote-web
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:80"
|
|
depends_on:
|
|
- inknote-server
|
|
|
|
# ─── Optional: PostgreSQL for production ───
|
|
# Uncomment to use PostgreSQL instead of SQLite
|
|
# inknote-db:
|
|
# image: postgres:16-alpine
|
|
# container_name: inknote-db
|
|
# restart: unless-stopped
|
|
# environment:
|
|
# POSTGRES_DB: inknote
|
|
# POSTGRES_USER: inknote
|
|
# POSTGRES_PASSWORD: ${DB_PASSWORD:-change-me}
|
|
# volumes:
|
|
# - postgres-data:/var/lib/postgresql/data
|
|
# ports:
|
|
# - "5432:5432"
|
|
|
|
volumes:
|
|
inknote-data:
|
|
inknote-uploads:
|
|
# postgres-data: |