version: "3.8"
services:
  database:
    image: postgis/postgis:13-master
    volumes:
      - directus:/var/lib/postgresql/data
    networks:
      - dokploy-network
    environment:
      POSTGRES_USER: "directus"
      POSTGRES_PASSWORD: "directus"
      POSTGRES_DB: "directus"

  cache:
    image: redis:6
    networks:
      - dokploy-network

  directus:
    image: directus/directus:10.12.1
    ports:
      - 8055
    volumes:
      - ../files/uploads:/directus/uploads
      - ../files/extensions:/directus/extensions
    depends_on:
      - cache
      - database
    environment:
      SECRET: "replace-with-secure-random-value"

      DB_CLIENT: "pg"
      DB_HOST: "database"
      DB_PORT: "5432"
      DB_DATABASE: "directus"
      DB_USER: "directus"
      DB_PASSWORD: "directus"

      CACHE_ENABLED: "true"
      CACHE_AUTO_PURGE: "true"
      CACHE_STORE: "redis"
      REDIS: "redis://cache:6379"

      ADMIN_EMAIL: "admin@example.com"
      ADMIN_PASSWORD: "d1r3ctu5"
volumes:
  directus:
