version: '3.8' # ============================================================================ # WebDAV Server - Docker Compose Configuration # ============================================================================ services: # -------------------------------------------------------------------------- # WebDAV Server # -------------------------------------------------------------------------- webdav: build: context: . dockerfile: Dockerfile container_name: webdav-server restart: unless-stopped ports: - "8080:8080" volumes: # Persistent storage for user files - ./webdav:/app/webdav # Database persistence - ./webdav.db:/app/webdav.db # Logs - ./logs:/app/logs # Backups - ./backups:/app/backups # Configuration (optional - uncomment to override) # - ./.env:/app/.env:ro environment: # Server Configuration - HOST=0.0.0.0 - PORT=8080 # Database - DB_PATH=/app/webdav.db # WebDAV Root - WEBDAV_ROOT=/app/webdav # Authentication - AUTH_METHODS=basic,digest - SESSION_TIMEOUT=3600 # Performance - MAX_CONNECTIONS=1000 - WORKERS=4 # Logging - LOG_LEVEL=INFO - LOG_FILE=/app/logs/webdav.log # Cache (if Redis enabled) - CACHE_ENABLED=false - REDIS_HOST=redis - REDIS_PORT=6379 networks: - webdav-network depends_on: - redis healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/"] interval: 30s timeout: 10s retries: 3 start_period: 10s # -------------------------------------------------------------------------- # Redis Cache (Optional but recommended for production) # -------------------------------------------------------------------------- redis: image: redis:7-alpine container_name: webdav-redis restart: unless-stopped ports: - "6379:6379" volumes: - redis-data:/data command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru networks: - webdav-network healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 3 # -------------------------------------------------------------------------- # Nginx Reverse Proxy with SSL (Production) # -------------------------------------------------------------------------- nginx: image: nginx:alpine container_name: webdav-nginx restart: unless-stopped ports: - "80:80" - "443:443" volumes: - ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro - ./nginx/conf.d:/etc/nginx/conf.d:ro - ./nginx/ssl:/etc/nginx/ssl:ro - ./logs/nginx:/var/log/nginx networks: - webdav-network depends_on: - webdav healthcheck: test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost/"] interval: 30s timeout: 10s retries: 3 # ============================================================================ # Networks # ============================================================================ networks: webdav-network: driver: bridge # ============================================================================ # Volumes # ============================================================================ volumes: redis-data: driver: local