services: vaultwarden-api: build: context: . dockerfile: Dockerfile container_name: vaultwarden-api restart: unless-stopped ports: - "127.0.0.1:8080:8080" environment: - API_PORT=8080 - ENVIRONMENT=production - API_KEY=${API_KEY} - VAULTWARDEN_URL=${VAULTWARDEN_URL} - VAULTWARDEN_EMAIL=${VAULTWARDEN_EMAIL} - VAULTWARDEN_PASSWORD=${VAULTWARDEN_PASSWORD} - ALLOWED_IPS=${ALLOWED_IPS} - ENABLE_GITHUB_IP_RANGES=${ENABLE_GITHUB_IP_RANGES:-false} - TRUSTED_PROXY_IP=${TRUSTED_PROXY_IP} - CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-http://localhost:3000} - SYNC_INTERVAL=${SYNC_INTERVAL:-5m} - CACHE_TTL=5m - READ_TIMEOUT=10s - WRITE_TIMEOUT=10s read_only: true tmpfs: - /tmp cap_drop: - ALL security_opt: - no-new-privileges:true deploy: resources: limits: cpus: '0.5' memory: 128M reservations: cpus: '0.25' memory: 64M healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8080/health"] interval: 30s timeout: 3s retries: 3 start_period: 10s logging: driver: "json-file" options: max-size: "10m" max-file: "3"