Files
dotcom-arcade/.env.example
T
Darkraise 3ba60aedf9 refactor(docker): build and ship a single API + UI image
Collapse the separate backend (Node) and frontend (nginx) images into
one image where the Express backend serves the built React app in
addition to the API and game content, so deployment is a single
container and one origin.

- Add a root Dockerfile with frontend-builder + backend-builder stages
  producing one runtime image; remove backend/ and frontend/ Dockerfiles,
  the nginx config, and the frontend entrypoint
- Serve the frontend dist and SPA fallback from Express (config.serveFrontend
  / FRONTEND_DIST_PATH), before auth/maintenance so the shell always loads and
  before the API 404 so client routes resolve to index.html
- Port the SPA-oriented CSP from nginx into Helmet, gated on serveFrontend;
  keep the strict API-only policy otherwise
- Reduce both compose files to a single flashpoint-web service on WEB_PORT
  -> 3100; drop API_PORT, BACKEND_HOST, BACKEND_PORT
- Build one image in the release workflow instead of a two-service matrix
- Update .env.example, README, workflow README, and env var docs

Also add .gitattributes (*.sh eol=lf) and normalize the entrypoint line
endings — without it, Windows checkouts bake CRLF into the image and the
shebang fails with "no such file or directory".
2026-08-11 16:02:06 +07:00

99 lines
3.7 KiB
Bash

# Flashpoint Web - Environment Template
# Copy to .env and fill in required values.
#
# Production: docker compose up -d
# Development: docker compose -f docker-compose.dev.yml up -d --build
# ---------------------------------------------------------------------------
# Required
# ---------------------------------------------------------------------------
FLASHPOINT_HOST_PATH=/path/to/Flashpoint
JWT_SECRET=replace-with-a-secure-random-string
# ---------------------------------------------------------------------------
# Container Image (production only)
# ---------------------------------------------------------------------------
# Override image tag (image from Docker Hub: darkraise/flashpoint-web)
# IMAGE_TAG=latest
# ---------------------------------------------------------------------------
# Port (host mapping)
# ---------------------------------------------------------------------------
# Maps a host port to the container, which serves both the UI and the API
# on port 3100
WEB_PORT=80
# ---------------------------------------------------------------------------
# Data Storage
# ---------------------------------------------------------------------------
# Host path for persistent data (user.db, local flashpoint.sqlite copy)
DATA_PATH=./data
# ---------------------------------------------------------------------------
# Logging
# ---------------------------------------------------------------------------
# Host path for logs (backend.log, client-errors.log)
LOGS_PATH=./logs
LOG_LEVEL=info
# ---------------------------------------------------------------------------
# OpenTelemetry (optional)
# ---------------------------------------------------------------------------
# Enable OTEL for distributed tracing and metrics
OTEL_ENABLED=false
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
# OTEL_API_KEY=your-api-key-here
OTEL_SERVICE_NAME=flashpoint-web
OTEL_TRACES_ENABLED=true
OTEL_METRICS_ENABLED=true
# OTEL_METRICS_EXPORT_INTERVAL=60000
# OTEL_LOG_LEVEL=info
# ---------------------------------------------------------------------------
# Container User Permissions
# ---------------------------------------------------------------------------
# Match your host user to avoid bind-mount permission issues
# Run 'id -u' and 'id -g' on your host to find your values
# PUID=1000
# PGID=1000
# ---------------------------------------------------------------------------
# Application settings
# ---------------------------------------------------------------------------
NODE_ENV=production
TZ=UTC
DOMAIN=http://localhost:80
# ---------------------------------------------------------------------------
# Database Performance Optimization (for network storage)
# ---------------------------------------------------------------------------
# Enable if FLASHPOINT_HOST_PATH is on a network share (SMB/NFS)
# Copies flashpoint.sqlite to local Docker volume for faster access
ENABLE_LOCAL_DB_COPY=false
# SQLite performance tuning
# SQLITE_CACHE_SIZE: Negative value = KB, -64000 = 64MB cache
SQLITE_CACHE_SIZE=-64000
# SQLITE_MMAP_SIZE: Memory-mapped I/O size in bytes (256MB default)
SQLITE_MMAP_SIZE=268435456
# Cache pre-warming (loads common queries on startup)
ENABLE_CACHE_PREWARM=true
# ---------------------------------------------------------------------------
# Auth & Rate Limiting
# ---------------------------------------------------------------------------
# JWT_EXPIRES_IN=1h
# BCRYPT_SALT_ROUNDS=10
# RATE_LIMIT_WINDOW_MS=60000
# RATE_LIMIT_MAX_REQUESTS=100
# ---------------------------------------------------------------------------
# Application
# ---------------------------------------------------------------------------
# HOME_RECENT_HOURS=24
# ENABLE_CGI=false
# Serve the built frontend from the backend (on by default in production)
# SERVE_FRONTEND=true