# SPDX-FileCopyrightText: 2023 Marlon W (Mawoka)
#
# SPDX-License-Identifier: MPL-2.0

services:
  db:
    #    build:
    #      context: pg_uuidv7
    #      args:
    #        PG_MAJOR_VERSION: 16
    image: postgres:16
    environment:
      POSTGRES_PASSWORD: mysecretpassword
      POSTGRES_DB: classquiz
    volumes:
      - db:/var/lib/postgresql/data
    ports:
      - 5432:5432
    restart: unless-stopped
  meilisearch:
    image: getmeili/meilisearch:v1.7
    volumes:
      - search:/meili_data
    ports:
      - 7700:7700
    environment:
      MEILI_NO_ANALYTICS: "true"
    restart: unless-stopped
  caddy:
    image: caddy:alpine
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile
    network_mode: "host"
    privileged: true
    restart: unless-stopped
  minio:
    image: docker.io/minio/minio
    environment:
      MINIO_ROOT_USER: classquiz
      MINIO_ROOT_PASSWORD: classquiz
      MINIO_ADDRESS: ":9000"
      MINIO_CONSOLE_ADDRESS: ":9001"
    volumes:
      - minio:/data
    ports:
      - 9000:9000
      - 9001:9001
    restart: unless-stopped
    command: minio server /data
  redis:
    image: redis:alpine
    restart: always
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
    ports:
      - 6379:6379
volumes:
  db:
  search:
  minio:
