## Portainer stack for dndextended. ## Env vars come from Portainer stack env or a .env file in the same dir. ## ## Required env: ## MONGODB_URI - mongodb://mongo:27017/dndextended (or external cluster) ## AUTH_SECRET - openssl rand -base64 32 ## AUTH_URL - public URL (https://dnd.example.com) ## AUTH_TRUST_HOST - true (behind Traefik/nginx/Pinggy) ## ## Optional: ## MONGO_ROOT_USER, MONGO_ROOT_PASSWORD - if you want mongo auth (recommended in prod) services: app: build: context: . dockerfile: Dockerfile image: dndextended:latest container_name: dndextended-app restart: unless-stopped ports: - "${APP_PORT:-3000}:3000" environment: NODE_ENV: production MONGODB_URI: ${MONGODB_URI:-mongodb://mongo:27017/dndextended} AUTH_SECRET: ${AUTH_SECRET} AUTH_URL: ${AUTH_URL} AUTH_TRUST_HOST: ${AUTH_TRUST_HOST:-true} depends_on: mongo: condition: service_healthy networks: - dnd mongo: image: mongo:7 container_name: dndextended-mongo restart: unless-stopped volumes: - mongo_data:/data/db environment: MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER:-} MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-} healthcheck: test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"] interval: 10s timeout: 5s retries: 5 start_period: 20s networks: - dnd volumes: mongo_data: networks: dnd: driver: bridge