services:
  postgres:
    container_name: postgres
    image: 'postgres:${POSTGRES_VERSION}'
    environment:
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
    healthcheck:
      test: [ "CMD", "pg_isready", "--username=user"]
      interval: 1s
      retries: 5


  backup-service:
    container_name: 'backup-service'
    build:
      context: '..'
      args:
        ALPINE_VERSION: '${ALPINE_VERSION}'
    depends_on:
      postgres:
        condition: service_healthy

    environment:
      # test constants
      POSTGRES_HOST: postgres
      POSTGRES_DATABASE: postgres
      POSTGRES_USER: user
      POSTGRES_PASSWORD: password
      S3_ACCESS_KEY_ID:
      S3_SECRET_ACCESS_KEY:
      S3_REGION:
      S3_BUCKET:


      # test variables
      SCHEDULE: '@yearly'
      S3_PREFIX: backup
      # PASSPHRASE: ''
      # BACKUP_KEEP_DAYS: ''
