version: "3.8"

services:
  web:
    image: makeplane/plane-frontend:${APP_RELEASE:-v0.27.1}
    command: node web/server.js web
    depends_on:
      - api
      - worker
    env_file:
      - .env

  space:
    image: makeplane/plane-space:${APP_RELEASE:-v0.27.1}
    command: node space/server.js space
    depends_on:
      - api
      - worker
      - web
    env_file:
      - .env

  admin:
    image: makeplane/plane-admin:${APP_RELEASE:-v0.27.1}
    command: node admin/server.js admin
    depends_on:
      - api
      - web
    env_file:
      - .env

  live:
    image: makeplane/plane-live:${APP_RELEASE:-v0.27.1}
    command: node live/dist/server.js live
    depends_on:
      - api
      - web
    env_file:
      - .env

  api:
    image: makeplane/plane-backend:${APP_RELEASE:-v0.27.1}
    command: ./bin/docker-entrypoint-api.sh
    volumes:
      - logs_api:/code/plane/logs
    depends_on:
      - plane-db
      - plane-redis
      - plane-mq
    env_file:
      - .env

  worker:
    image: makeplane/plane-backend:${APP_RELEASE:-v0.27.1}
    command: ./bin/docker-entrypoint-worker.sh
    volumes:
      - logs_worker:/code/plane/logs
    depends_on:
      - api
      - plane-db
      - plane-redis
      - plane-mq
    env_file:
      - .env

  beat-worker:
    image: makeplane/plane-backend:${APP_RELEASE:-v0.27.1}
    command: ./bin/docker-entrypoint-beat.sh
    volumes:
      - logs_beat-worker:/code/plane/logs
    depends_on:
      - api
      - plane-db
      - plane-redis
      - plane-mq
    env_file:
      - .env

  migrator:
    image: makeplane/plane-backend:${APP_RELEASE:-v0.27.1}
    command: ./bin/docker-entrypoint-migrator.sh
    volumes:
      - logs_migrator:/code/plane/logs
    depends_on:
      - plane-db
      - plane-redis
    env_file:
      - .env

  plane-db:
    image: postgres:17-alpine
    command: postgres -c 'max_connections=1000'
    volumes:
      - pgdata:/var/lib/postgresql/data
    env_file:
      - .env

  plane-redis:
    image: valkey/valkey:7.2.5-alpine
    volumes:
      - redisdata:/data
    env_file:
      - .env

  plane-mq:
    image: rabbitmq:3.13.6-management-alpine
    volumes:
      - rabbitmq_data:/var/lib/rabbitmq
    env_file:
      - .env

  plane-minio:
    image: minio/minio:latest
    command: server /export --console-address ":9090"
    volumes:
      - uploads:/export
    env_file:
      - .env

  proxy:
    image: makeplane/plane-proxy:${APP_RELEASE:-v0.27.1}
    depends_on:
      - web
      - api
      - space
    env_file:
      - .env

volumes:
  pgdata:
  redisdata:
  uploads:
  logs_api:
  logs_worker:
  logs_beat-worker:
  logs_migrator:
  rabbitmq_data:
