---
version: "3"
services:
  db:
    image: gnuviech/pgsql:buster
    ports:
      - "15432:5432"
    env_file: .env
    volumes:
      - "pg_data:/var/lib/postgresql/11/main"
  mq:
    image: gnuviech/mq:buster
    env_file: .env
    volumes:
      - "mq_data:/var/lib/rabbitmq/mnesia"
  redis:
    image: gnuviech/redis:buster
    env_file: .env
    volumes:
      - "redis_data:/var/lib/redis"
  gva:
    image: gnuviech/gva:bookworm
    build:
      context: .
      args:
        GVAGID: 1000
        GVAUID: 1000
    ports:
      - "8000:8000"
    depends_on:
      - db
      - mq
      - redis
    env_file: .env
    environment:
      DJANGO_SETTINGS_MODULE: gnuviechadmin.settings
      GVA_DOMAIN_NAME: localhost
      GVA_SITE_NAME: localhost
    volumes:
      - "django_media:/srv/gva/media"
      - "django_static:/srv/gva/static"
      - "./gnuviechadmin:/srv/gva/gnuviechadmin"
  web:
    image: gnuviech/gvaweb:buster
    build:
      context: ../gvaweb
      args:
        GVAGID: 1000
        GVAUID: 1000
    depends_on:
      - mq
      - redis
    env_file: ../gvaweb/.env
    volumes:
      - "../gvaweb/gvaweb:/srv/gvaweb/gvaweb"
  ldap:
    image: gnuviech/gvaldap:buster
    build:
      context: ../gvaldap
      args:
        GVAGID: 1000
        GVAUID: 1000
    depends_on:
      - mq
      - redis
    env_file: ../gvaldap/.env
    volumes:
      - "../gvaldap/gvaldap:/srv/gvaldap/gvaldap"
  file:
    image: gnuviech/gvafile:bookworm
    build:
      context: ../gvafile
      args:
        GVAGID: 1000
        GVAUID: 1000
    depends_on:
      - mq
      - redis
    env_file: ../gvafile/.env
    volumes:
      - "../gvafile/gvafile:/srv/gvafile/gvafile"
  pgsql:
    image: gnuviech/gvapgsql:buster
    build:
      context: ../gvapgsql
      args:
        GVAGID: 1000
        GVAUID: 1000
    depends_on:
      - mq
      - redis
    env_file: ../gvapgsql/.env
    volumes:
      - "../gvapgsql/gvapgsql:/srv/gvapgsql/gvapgsql"
  mysql:
    image: gnuviech/gvamysql:buster
    build:
      context: ../gvamysql
      args:
        GVAGID: 1000
        GVAUID: 1000
    depends_on:
      - mq
      - redis
    env_file: ../gvamysql/.env
    volumes:
      - "../gvamysql/gvamysql:/srv/gvamysql/gvamysql"
volumes:
  django_media:
  django_static:
  pg_data:
  redis_data:
  mq_data:
