services:

  integration:
    platform: linux/amd64
    build:
      context: .
      target: integration
    volumes:
      - .:/var/app
    environment:
      - RDS_MYSQL_HOST=${RDS_MYSQL_HOST}
      - TEST_BASE_URL=${TEST_BASE_URL}
      - RDS_MYSQL_USER=${RDS_MYSQL_USER}
      - RDS_MYSQL_PASSWORD=${RDS_MYSQL_PASSWORD}
      - RDS_MYSQL_DATABASE=${RDS_MYSQL_DATABASE}
      - RDS_MYSQL_PORT=${RDS_MYSQL_PORT}

  unit-lint:
    platform: linux/amd64
    build:
      context: .
      target: unit-lint
    volumes:
      - .:/var/app

  timed-release-dev:
    platform: linux/amd64
    build:
      context: .
      target: dev
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s
    ports:
      - "5000:5000"
    volumes:
      - .:/var/app
    env_file:
      - path: .env
        required: false
    environment:
      - Environment=dev

  timed-release-deploy:
    platform: linux/amd64
    build:
      context: .
      target: deploy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s