version: "3"

services:
  docmost:
    image: docmost/docmost:0.4.1
    depends_on:
      - db
      - redis
    environment:
      - APP_URL
      - APP_SECRET
      - DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?schema=public
      - REDIS_URL=redis://redis:6379
    restart: unless-stopped

    volumes:
      - docmost:/app/data/storage

  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_DB
      - POSTGRES_USER
      - POSTGRES_PASSWORD
    restart: unless-stopped

    volumes:
      - db_docmost_data:/var/lib/postgresql/data

  redis:
    image: redis:7.2-alpine
    restart: unless-stopped

    volumes:
      - redis_docmost_data:/data

networks:
  dokploy-network:
    external: true

volumes:
  docmost:
  db_docmost_data:
  redis_docmost_data: