services: dockmon: build: context: . dockerfile: docker/Dockerfile # Optional: Set BASE_PATH for reverse proxy subpath deployment (uncomment and edit if needed) # Example: For accessing DockMon at https://domain.com/dockmon/ # args: # - BASE_PATH=/dockmon/ container_name: dockmon restart: unless-stopped security_opt: - no-new-privileges:true ports: - "8001:443" # HTTPS only - backend access through nginx proxy environment: - TZ=America/New_York # Change to your local timezone (e.g., Europe/London, Asia/Tokyo, etc.) - PYTHONPATH=/app/backend - PYTHONUNBUFFERED=1 # Optional: Set BASE_PATH for runtime (must match build arg above) # - BASE_PATH=/dockmon/ # Optional: External URL for notification action links (one-click update buttons) # Set this to your DockMon URL so notifications can include direct action links # - DOCKMON_EXTERNAL_URL=https://dockmon.example.com # Optional: Set CORS origins for production deployment (uncomment and edit if needed) # Leave empty/commented for development (auto-detects localhost) # - DOCKMON_CORS_ORIGINS=https://dockmon.yourcompany.com - DOCKMON_CORS_ORIGINS= volumes: - dockmon_data:/app/data - /var/run/docker.sock:/var/run/docker.sock # For local Docker monitoring (auto-configured on first run) logging: driver: "json-file" options: max-size: "10m" # Maximum size of each log file max-file: "3" # Keep 3 log files (30MB total max) compress: "true" # Compress rotated logs healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 start_period: 30s labels: - "com.dockmon.description=All-in-One Docker Container Monitor" - "com.dockmon.version=1.0" # ================================================================================== # REVERSE PROXY DEPLOYMENT (Traefik, Caddy, nginx Proxy Manager, etc.) # ================================================================================== # For comprehensive setup guides including Traefik, Caddy, nginx Proxy Manager, # HTTPS passthrough, subpath deployment, and troubleshooting, see: # https://github.com/darthnorse/dockmon/wiki/Reverse-Proxy-Deployment # # Quick example for HTTP mode (most common): # # dockmon: # build: # context: . # dockerfile: docker/Dockerfile # container_name: dockmon # restart: unless-stopped # ports: # - "8080:80" # HTTP mode - reverse proxy handles HTTPS # environment: # - TZ=America/New_York # - PYTHONPATH=/app/backend # - PYTHONUNBUFFERED=1 # - REVERSE_PROXY_MODE=true # Enable HTTP mode # - DOCKMON_CORS_ORIGINS=https://dockmon.example.com # volumes: # - dockmon_data:/app/data # - /var/run/docker.sock:/var/run/docker.sock # networks: # - traefik # labels: # - "traefik.enable=true" # - "traefik.http.routers.dockmon.rule=Host(`dockmon.example.com`)" # - "traefik.http.routers.dockmon.entrypoints=websecure" # - "traefik.http.routers.dockmon.tls.certresolver=letsencrypt" # - "traefik.http.services.dockmon.loadbalancer.server.port=80" # # networks: # traefik: # external: true volumes: dockmon_data: driver: local