# Docker Compose Template for Compose Anything # This template provides a standardized structure for all services # Copy this template when creating new services x-defaults: &defaults restart: unless-stopped logging: driver: json-file options: max-size: 100m max-file: "3" #! Example service structure: services: service-name: <<: *defaults image: ${GLOBAL_REGISTRY:-}image:${VERSION:-latest} ports: - "${PORT_OVERRIDE:-8080}:8080" volumes: - service_data:/data environment: - TZ=${TZ:-UTC} - ENV_VAR=${ENV_VAR:-default_value} healthcheck: test: ["CMD", "command", "to", "check", "health"] interval: 30s timeout: 10s retries: 3 start_period: 10s deploy: resources: limits: cpus: ${SERVICE_NAME_CPU_LIMIT:-0.50} memory: ${SERVICE_NAME_MEMORY_LIMIT:-256M} reservations: cpus: ${SERVICE_NAME_CPU_RESERVATION:-0.25} memory: ${SERVICE_NAME_MEMORY_RESERVATION:-128M} volumes: service_data: