feat: add Docker configuration and environment setup for backend and frontend

This commit is contained in:
2026-03-11 22:49:59 +01:00
parent cb49c3e50a
commit dc29976c1f
5 changed files with 168 additions and 1 deletions

44
.env.example Normal file
View File

@@ -0,0 +1,44 @@
# Copy this file to .env and fill in the values before running `docker compose up`.
# ── Ports (optional, defaults shown) ─────────────────────────────────────────
BACKEND_PORT=3000
FRONTEND_PORT=3001
# ── Auth ──────────────────────────────────────────────────────────────────────
# Generate: openssl rand -hex 32
JWT_SECRET=change-me-generate-with-openssl-rand-hex-32
# Generate: openssl rand -base64 64
COOKIE_SECRET=change-me-must-be-at-least-64-characters-long-for-production!!
JWT_EXPIRY_HOURS=24
# Set to true when serving over HTTPS
SECURE_COOKIE=false
PRODUCTION=false
# ── CORS ──────────────────────────────────────────────────────────────────────
# Origin(s) from which the browser will hit the backend, comma-separated.
# Must match what users type in their browser for the frontend.
# Example (local): http://localhost:3001
# Example (remote): https://tv.example.com
CORS_ALLOWED_ORIGINS=http://localhost:3001
# ── Frontend / API URL ────────────────────────────────────────────────────────
# Public URL of the BACKEND, as seen from the user's browser.
# This is baked into the Next.js client bundle at build time.
# Example (local): http://localhost:3000/api/v1
# Example (remote): https://api.example.com/api/v1
NEXT_PUBLIC_API_URL=http://localhost:3000/api/v1
# ── Jellyfin ──────────────────────────────────────────────────────────────────
JELLYFIN_BASE_URL=http://jellyfin:8096
JELLYFIN_API_KEY=your-jellyfin-api-key-here
JELLYFIN_USER_ID=your-jellyfin-user-id-here
# ── Database pool (optional) ──────────────────────────────────────────────────
DB_MAX_CONNECTIONS=5
DB_MIN_CONNECTIONS=1
# ── PostgreSQL (optional, uncomment db service in compose.yml first) ──────────
# POSTGRES_PASSWORD=change-me