version: '3.0'

services:

  gateway:
    image: dnapef/gateway:${TAG:-latest}
    depends_on:
      - backend
    ports:
      - 443:8443
    volumes:
      - gateway_config:/workspace/config

  redirect:
    image: dnapef/redirect
    ports:
      - 80:80

  backend:
    image: dnapef/backend:${TAG:-latest}
    depends_on:
      - postgres
    volumes:
      - backend_db:/home/app/db
      - backend_logs:/home/app/logs
      - backend_config:/home/app/config

  postgres:
    image: postgres:13
    environment:
      POSTGRES_DB: dna_analyser
      POSTGRES_USER: ${POSTGRES_USER:-developer}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
      PGDATA: /data/postgres
    volumes:
      - postgres:/data/postgres
    ports:
      - 5432:5432

  pgadmin:
    image: dpage/pgadmin4:latest
    depends_on:
      - postgres
    environment:
      PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:-user@mendelu.cz}
      PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-user}
    volumes:
      - pgadmin:/root/.pgadmin
    ports:
      - 5050:80



volumes:
  postgres:
  pgadmin:
  gateway_config:
  backend_db:
  backend_logs:
  backend_config:

