services:
  enketo:
    build:
      dockerfile: mock-http-service.dockerfile
    ports:
      - "8005:8005"
    environment:
      - PORT=8005
  service:
    build:
      dockerfile: mock-http-service.dockerfile
    ports:
      - "8383:8383"
    environment:
      - PORT=8383
  nginx:
    build:
      context: ../..
      dockerfile: nginx.dockerfile
      args:
        SKIP_FRONTEND_BUILD: true
    depends_on:
      - service
      - enketo
    environment:
      - DOMAIN=odk-nginx.example.test
      - SENTRY_KEY=example-sentry-key
      - SENTRY_ORG_SUBDOMAIN=example-sentry-org-subdomain
      - SENTRY_PROJECT=example-sentry-project
      - SSL_TYPE=selfsign
      - OIDC_ENABLED=false
    volumes:
      - ../../files/nginx/odk.conf.template:/usr/share/odk/nginx/odk.conf.template:ro
      - ../../files/nginx/client-config.json.template:/usr/share/odk/nginx/client-config.json.template:ro
      - ./files/nginx/dh.pem:/etc/dh/nginx.pem:ro
    ports:
      - "9000:80"
      - "9001:443"
    healthcheck:
      test: [ "CMD-SHELL", "nc -z localhost 80 || exit 1" ]
    restart: always
    logging:
      driver: local
      options:
        max-file: "30"
