version: '3.8'
services:
  app:
    image: 'nginx'
    environment:
      DB_URL: 'postgres://$POSTGRES_USER:$POSTGRES_PASSWORD@db/postgres'
      APP_KEY: base64
      APP_DEBUG: '${APP_DEBUG:-false}'
    volumes:
      - './index.html:/usr/share/nginx/html/index.html'
      - 'test-html:/html'
    depends_on:
      - db
  db:
    image: postgres
    environment:
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
    volumes:
      - 'data:/var/lib/postgresql/data'
    healthcheck:
      test:
        - CMD
        - pg_isready
        - '-U'
        - postgres
      interval: 2s
      timeout: 10s
      retries: 10
