services: db: container_name: yh-community-contacts-api-db image: postgres:14-alpine environment: POSTGRES_DB: community_contacts_api POSTGRES_USER: postgres POSTGRES_PASSWORD: password ports: - 5432:5432 volumes: - yh-community-contacts-api-db-data:/var/lib/postgresql/data app: container_name: yh-community-contacts-api build: context: . deploy: resources: limits: cpus: "${DOCKER_APP_CPUS:-0}" memory: "${DOCKER_APP_MEMORY:-0}" env_file: .env environment: DB_CLIENT: "postgresql" DB_CONNECTION_STRING: "postgresql://postgres:password@yh-community-contacts-api-db:5432/community_contacts_api" LOG_ROTATION_DATE_FORMAT: LOG_ROTATION_FILENAME: NODE_ENV: production HOST: 0.0.0.0 healthcheck: test: curl "localhost:${PORT:-3000}/admin/healthcheck" interval: 60s timeout: 3s start_period: 5s retries: 3 labels: # Using OCI Image Format spec # See https://github.com/opencontainers/image-spec/blob/main/annotations.md org.opencontainers.image.authors: Frazer Smith org.opencontainers.image.licenses: MIT org.opencontainers.image.url: https://github.com/Fdawgs/yh-community-contacts-api logging: options: max-file: "${LOG_ROTATION_MAX_LOGS:-10}" max-size: "${LOG_ROTATION_MAX_SIZE:-100m}" ports: - "127.0.0.1:${PORT:-3000}:${PORT:-3000}" restart: "${DOCKER_RESTART_POLICY:-unless-stopped}" volumes: yh-community-contacts-api-db-data: external: false