# Local single-container run: API + web app on http://localhost:3000, SQLite in ./data. # # docker compose up --build # # Configuration comes from a repo-root `.env` (copy `.env.example`), e.g. # GOOGLE_BOOKS_API_KEY. Container-specific values below win over `.env`. services: bookguardian: build: context: . args: # Build-time only: the origin baked into the landing page's canonical / # Open Graph tags (crawlers never run the SPA). Unset ⇒ relative tags; # a real deployment sets PUBLIC_ORIGIN in .env, same value as # AUTH_BASE_URL. Changing it requires a rebuild, not a restart. PUBLIC_ORIGIN: ${PUBLIC_ORIGIN:-} image: bookguardian:local ports: - '3000:3000' env_file: - path: .env required: false environment: NODE_ENV: production PORT: '3000' DB_DRIVER: sqlite DATABASE_PATH: /data/bookguardian.db WEB_DIST: /app/web # "Today" for read dates; override in .env or the shell (TZ=Europe/Madrid). TZ: ${TZ:-UTC} # Google sign-in — runtime variables, never baked into the image. Put the # values in .env (or the Coolify/host environment); see README "Google sign-in". # GOOGLE_CLIENT_ID: ${GOOGLE_CLIENT_ID} # GOOGLE_CLIENT_SECRET: ${GOOGLE_CLIENT_SECRET} # Public origin; register ${AUTH_BASE_URL}/api/auth/google/callback in Google Cloud. # AUTH_BASE_URL: ${AUTH_BASE_URL:-http://localhost:3000} # AUTH_COOKIE_SECRET: ${AUTH_COOKIE_SECRET} # AUTH_ALLOWED_EMAILS: ${AUTH_ALLOWED_EMAILS} # AUTH_SESSION_DAYS: ${AUTH_SESSION_DAYS:-30} volumes: # On Linux create ./data first (mkdir -p data) so it is owned by you, not root; # the container runs as uid 1000 (node). - ./data:/data restart: unless-stopped