# Base stack — works standalone for local smoke testing (`docker compose up`). # The service binds 127.0.0.1:8080; a host reverse proxy (nginx/Caddy/Traefik) # terminates TLS for manga-api. and forwards to it. # # If your proxy runs in Docker on its own network, use the prod override which # attaches to that network instead of publishing a port: # docker compose -f docker-compose.yml -f docker-compose.prod.yml up -d services: manga-api: build: ./backend image: mangabm-backend:latest container_name: manga-api restart: unless-stopped environment: # API_TOKEN is required — compose refuses to start without it. API_TOKEN: ${API_TOKEN:?set API_TOKEN in .env} ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-https://asuracomic.net,https://asurascans.com,https://demonicscans.org} DB_PATH: /data/bookmarks.db PORT: "8080" # Gates the browser UI. Unset means the web routes are not served at all. WEB_PASSWORD: ${WEB_PASSWORD:-} # Path inside the container; matches the bindmount above. USERSCRIPT_PATH: ${USERSCRIPT_PATH:-/userscript/manga-bookmark.user.js} # Latest-chapter poller. LATEST_CHAPTER_POLL_ENABLED=0 in .env is the kill # switch; it only takes effect because these are listed here. LATEST_CHAPTER_POLL_ENABLED: ${LATEST_CHAPTER_POLL_ENABLED:-1} LATEST_CHAPTER_POLL_COOLDOWN: ${LATEST_CHAPTER_POLL_COOLDOWN:-1h} LATEST_CHAPTER_POLL_INTERVAL: ${LATEST_CHAPTER_POLL_INTERVAL:-10m} LATEST_CHAPTER_POLL_BATCH: ${LATEST_CHAPTER_POLL_BATCH:-14} LATEST_CHAPTER_POLL_STAGGER: ${LATEST_CHAPTER_POLL_STAGGER:-20s} volumes: - bookmarks-data:/data # The userscript is served from here, read fresh on every request. Editing # the file in this checkout takes effect on the next Violentmonkey poll — # no rebuild, no restart. `git pull` restores the committed version, which # is why a redeploy always ships the repo's script. - ./userscript:/userscript:ro # Bound to loopback only: the proxy (or curl during smoke test) reaches it, # the public internet does not. ports: - "127.0.0.1:8080:8080" volumes: bookmarks-data: