services: backup: image: postgres:17.7-alpine environment: PGHOST: ${DB_HOST} PGPORT: ${DB_PORT} PGDATABASE: ${DB_NAME} PGUSER: ${DB_USER} PGPASSWORD: ${DB_PASSWORD} entrypoint: ["pg_dump"] command: - "--format=custom" - "--no-owner" - "--no-privileges" - "--file=/backup/current.dump" volumes: - ${BACKUP_DIR}:/backup