name: miniplan

networks:
  backend:

services:
  db:
    image: postgres
    restart: always
    environment:
      - POSTGRES_PASSWORD=minis
      - POSTGRES_USER=minis
      - POSTGRES_DB=minis
    networks:
      - backend
    healthcheck:
      test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
      interval: 30s
      timeout: 60s
      retries: 5
      start_period: 80s
  app:
    image: git.walamana.de/walamana/miniplan:latest
    restart: no
    depends_on:
      - db
    networks:
      - backend
    environment:
      - KTOR_DEPLOYMENT_PORT=8081
      - KTOR_DEVELOPMENT=true
      - JWT_SECRET=${JWT_SECRET}
      - JWT_ISSUER=${JWT_ISSUER}
      - JWT_AUDIENCE=${JWT_AUDIENCE}
      - JWT_REALM=${JWT_REALM}
      - DATABASE_URL=jdbc:postgresql://db:5432/minis
      - DATABASE_DRIVER=org.postgresql.Driver
      - DATABASE_USER=minis
      - DATABASE_PASSWORD=minis
      - ADMIN_PASSWORD=${ADMIN_PASSWORD}
      - FRONTEND_PATH=./public
    ports:
      - 8081:8081

