makeplane / plane

🔥 🔥 🔥 Open Source JIRA, Linear, Monday, and Asana Alternative. Plane helps you track your issues, epics, and product roadmaps in the simplest way possible.
http://plane.so
GNU Affero General Public License v3.0
29.44k stars 1.62k forks source link

[bug]: Coolify Docker compose file is not working #4227

Open s-peryt opened 5 months ago

s-peryt commented 5 months ago

Is there an existing issue for this?

Current behavior

I'm trying to run Pilot on Coolify through Docker Compose resource. I've copied content of https://github.com/makeplane/plane/blob/preview/deploy/coolify/coolify-docker-compose.yml which always results in error Duplicate entry found. Please use a different name. and when I try to run the instance I am getting fatal crash of Cooliy:

Something is not okay, are you okay? There has been an error, we are working on it. Error: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "service_applications_fqdn_unique" DETAIL: Key (fqdn)=(http://plane-xwogs0c/.\<IP>.sslip.io:8082) already exists. (Connection: pgsql, SQL: update "service_applications" set "fqdn" = http://plane-xwogs0c/.\<IP>.sslip.io:8082, "updated_at" = 2024-04-16 21:31:39 where "id" = 96)

Steps to reproduce

  1. On Coolify create new Resource "Docker Compose"
  2. Copy-paste content of https://github.com/makeplane/plane/blob/preview/deploy/coolify/coolify-docker-compose.yml
  3. Save (results in error Duplicate entry found. Please use a different name. but resource is still created)
  4. Deploy resource - crashes

Environment

Production

Browser

None

Variant

Self-hosted

Version

v0.17-dev

vniehues commented 5 months ago

I'm experiencing the same issue. @s-peryt did you manage to resolve it?

jonkristian commented 4 months ago

Hello :)

I believe that error is because of the container_name usage. I've been trying to get plane.so fired up on coolify myself. Services in the following compose is running just fine and the onboarding screen is loading, however I can't get further, I get 404 on the /users/* endpoint.

Anyhow, this compose should resolve your errors, now It's just figuring out the rest.

services:
  web:
    image: makeplane/plane-frontend:latest
    restart: unless-stopped
    command: /usr/local/bin/start.sh web/server.js web
    environment:
      - SERVICE_FQDN_PLANE
      - NEXT_PUBLIC_DEPLOY_URL=$SERVICE_FQDN_PLANE
    depends_on:
      - api
      - worker

  space:
    image: makeplane/plane-space:latest
    restart: unless-stopped
    command: /usr/local/bin/start.sh space/server.js space
    environment:
      - SERVICE_FQDN_PLANE=/api
    depends_on:
      - api
      - worker
      - web

  api:
    image: makeplane/plane-backend:latest
    restart: unless-stopped
    command: ./bin/takeoff
    environment:
      - NGINX_PORT=${NGINX_PORT:-8082}
      - WEB_URL=$SERVICE_FQDN_PLANE

      - DEBUG=${DEBUG:-0}
      - USE_MINIO=${USE_MINIO:-1}
      - GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}

      - REDIS_HOST=${REDIS_HOST:-plane-redis}
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_URL=${REDIS_URL:-redis://plane-redis:6379}
      - DATABASE_URL=postgres://${POSTGRES_USER:-plane}:$SERVICE_PASSWORD_POSTGRES@plane-db/${POSTGRES_DB:-plane}?sslmode=disable

      - EMAIL_HOST=${EMAIL_HOST:-""}
      - EMAIL_HOST_USER=${EMAIL_HOST_USER:-""}
      - EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD:-""}
      - EMAIL_PORT=${EMAIL_PORT:-587}
      - EMAIL_FROM=${EMAIL_FROM:-Team Plane <team@mailer.plane.so>}
      - EMAIL_USE_TLS=${EMAIL_USE_TLS:-1}
      - EMAIL_USE_SSL=${EMAIL_USE_SSL:-0}

      - USE_MINIO=${USE_MINIO:-1}
      - AWS_REGION=${AWS_REGION:-""}
      - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-access-key}
      - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-secret-key}
      - AWS_S3_ENDPOINT_URL=${AWS_S3_ENDPOINT_URL:-http://plane-minio:9000}
      - AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-uploads}
      - FILE_SIZE_LIMIT=${FILE_SIZE_LIMIT:-5242880}

      - OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}
      - OPENAI_API_KEY=${OPENAI_API_KEY:-sk-}
      - GPT_ENGINE=${GPT_ENGINE:-gpt-3.5-turbo}
      - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-""}
      - DOCKERIZED=${DOCKERIZED:-1}

      - DEFAULT_EMAIL=${DEFAULT_EMAIL:-captain@plane.so}
      - DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-password123}
      - ENABLE_SIGNUP=${ENABLE_SIGNUP:-1}
      - ENABLE_EMAIL_PASSWORD=${ENABLE_EMAIL_PASSWORD:-1}
      - ENABLE_MAGIC_LINK_LOGIN=${ENABLE_MAGIC_LINK_LOGIN:-0}
      - SECRET_KEY=${SECRET_KEY:-60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5}
    depends_on:
      - plane-db
      - plane-redis

  worker:
    image: makeplane/plane-backend:latest
    restart: unless-stopped
    command: ./bin/worker
    environment:
      - DEBUG=${DEBUG:-0}
      - USE_MINIO=${USE_MINIO:-1}
      - GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}

      - REDIS_HOST=${REDIS_HOST:-plane-redis}
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_URL=${REDIS_URL:-redis://plane-redis:6379}
      - DATABASE_URL=postgres://${POSTGRES_USER:-plane}:$SERVICE_PASSWORD_POSTGRES@plane-db/${POSTGRES_DB:-plane}?sslmode=disable

      - EMAIL_HOST=${EMAIL_HOST:-""}
      - EMAIL_HOST_USER=${EMAIL_HOST_USER:-""}
      - EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD:-""}
      - EMAIL_PORT=${EMAIL_PORT:-587}
      - EMAIL_FROM=${EMAIL_FROM:-Team Plane <team@mailer.plane.so>}
      - EMAIL_USE_TLS=${EMAIL_USE_TLS:-1}
      - EMAIL_USE_SSL=${EMAIL_USE_SSL:-0}

      - USE_MINIO=${USE_MINIO:-1}
      - AWS_REGION=${AWS_REGION:-""}
      - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-access-key}
      - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-secret-key}
      - AWS_S3_ENDPOINT_URL=${AWS_S3_ENDPOINT_URL:-http://plane-minio:9000}
      - AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-uploads}
      - FILE_SIZE_LIMIT=${FILE_SIZE_LIMIT:-5242880}
      - NGINX_PORT=${NGINX_PORT:-8082}

      - OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}
      - OPENAI_API_KEY=${OPENAI_API_KEY:-sk-}
      - GPT_ENGINE=${GPT_ENGINE:-gpt-3.5-turbo}
      - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-""}
      - DOCKERIZED=${DOCKERIZED:-1}

      - DEFAULT_EMAIL=${DEFAULT_EMAIL:-captain@plane.so}
      - DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-password123}
      - ENABLE_SIGNUP=${ENABLE_SIGNUP:-1}
      - ENABLE_EMAIL_PASSWORD=${ENABLE_EMAIL_PASSWORD:-1}
      - ENABLE_MAGIC_LINK_LOGIN=${ENABLE_MAGIC_LINK_LOGIN:-0}
      - SECRET_KEY=${SECRET_KEY:-60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5}
    depends_on:
      - api
      - plane-db
      - plane-redis

  beat-worker:
    image: makeplane/plane-backend:latest
    restart: unless-stopped
    command: ./bin/beat
    environment:
      - DEBUG=${DEBUG:-0}
      - USE_MINIO=${USE_MINIO:-1}
      - CORS_ALLOWED_ORIGINS=${CORS_ALLOWED_ORIGINS:-http://localhost:3000}
      - GUNICORN_WORKERS=${GUNICORN_WORKERS:-2}

      - REDIS_HOST=${REDIS_HOST:-plane-redis}
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_URL=${REDIS_URL:-redis://plane-redis:6379}
      - DATABASE_URL=postgres://${POSTGRES_USER:-plane}:$SERVICE_PASSWORD_POSTGRES@plane-db/${POSTGRES_DB:-plane}?sslmode=disable

      - EMAIL_HOST=${EMAIL_HOST:-""}
      - EMAIL_HOST_USER=${EMAIL_HOST_USER:-""}
      - EMAIL_HOST_PASSWORD=${EMAIL_HOST_PASSWORD:-""}
      - EMAIL_PORT=${EMAIL_PORT:-587}
      - EMAIL_FROM=${EMAIL_FROM:-Team Plane <team@mailer.plane.so>}
      - EMAIL_USE_TLS=${EMAIL_USE_TLS:-1}
      - EMAIL_USE_SSL=${EMAIL_USE_SSL:-0}

      - USE_MINIO=${USE_MINIO:-1}
      - AWS_REGION=${AWS_REGION:-""}
      - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID:-access-key}
      - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY:-secret-key}
      - AWS_S3_ENDPOINT_URL=${AWS_S3_ENDPOINT_URL:-http://plane-minio:9000}
      - AWS_S3_BUCKET_NAME=${AWS_S3_BUCKET_NAME:-uploads}
      - FILE_SIZE_LIMIT=${FILE_SIZE_LIMIT:-5242880}
      - NGINX_PORT=${NGINX_PORT:-8082}

      - OPENAI_API_BASE=${OPENAI_API_BASE:-https://api.openai.com/v1}
      - OPENAI_API_KEY=${OPENAI_API_KEY:-sk-}
      - GPT_ENGINE=${GPT_ENGINE:-gpt-3.5-turbo}
      - GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET:-""}
      - DOCKERIZED=${DOCKERIZED:-1}

      - DEFAULT_EMAIL=${DEFAULT_EMAIL:-captain@plane.so}
      - DEFAULT_PASSWORD=${DEFAULT_PASSWORD:-password123}
      - ENABLE_SIGNUP=${ENABLE_SIGNUP:-1}
      - ENABLE_EMAIL_PASSWORD=${ENABLE_EMAIL_PASSWORD:-1}
      - ENABLE_MAGIC_LINK_LOGIN=${ENABLE_MAGIC_LINK_LOGIN:-0}
      - SECRET_KEY=${SECRET_KEY:-60gp0byfz2dvffa45cxl20p1scy9xbpf6d8c5y0geejgkyp1b5}
    depends_on:
      - api
      - plane-db
      - plane-redis

  migrator:
    image: makeplane/plane-backend:latest
    restart: no
    command: >
      sh -c "python manage.py wait_for_db &&
           python manage.py migrate"
    environment:
      - REDIS_HOST=${REDIS_HOST:-plane-redis}
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_URL=${REDIS_URL:-redis://plane-redis:6379}
      - DATABASE_URL=postgres://${POSTGRES_USER:-plane}:$SERVICE_PASSWORD_POSTGRES@plane-db/${POSTGRES_DB:-plane}?sslmode=disable
    depends_on:
      - plane-db
      - plane-redis

  plane-db:
    image: postgres:16-alpine
    restart: unless-stopped
    volumes:
      - postgresql:/var/lib/postgresql/data
    environment:
      - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
      - POSTGRES_USER=${POSTGRES_USER:-plane}
      - POSTGRES_DB=${POSTGRES_DB:-plane}
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U $POSTGRES_USER -d $POSTGRES_DB"]
      interval: 2s
      timeout: 10s
      retries: 15

  plane-redis:
    image: redis:7-alpine
    restart: unless-stopped
    volumes:
      - redis:/data
    environment:
      - REDIS_HOST=${REDIS_HOST:-plane-redis}
      - REDIS_PORT=${REDIS_PORT:-6379}
      - REDIS_URL=${REDIS_URL:-redis://plane-redis:6379/}
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 2s
      timeout: 10s
      retries: 15

  plane-minio:
    image: quay.io/minio/minio
    restart: unless-stopped
    command: server /data --console-address ":9090"
    environment:
      - MINIO_ROOT_USER=${MINIO_ROOT_USER:-access-key}
      - MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-secret-key}
    volumes:
      - minio:/data

volumes:
  letsencrypt:
  postgresql:
  redis:
  minio:
replete commented 4 months ago

@jonkristian I have the same problem, got plane running via docker-compose in Coolify, see a spinner in the browser, 502 Bad Gateway on /api. Did you manage to figure it out?

eb-tsx commented 4 months ago

I have noticed that using the default docker composer image exposes api to http://0.0.0.0:8000 Coolify also uses port 8000

Maybe that causes conflicts? I am new to coolify and have also been trying to run plane with it

My current alternative is running plane in another vps with nginx proxy manager so far

a-w-1806 commented 2 months ago

Second this. It would be awesome if we can run this in Coolify

replete commented 2 months ago

I think this is probably a duplicate of this bug: https://github.com/coollabsio/coolify/issues/1996

Basically, when you use the docker compose option and git, it does not copy the files from your repo into the artifact. It's understandable why they might do that, but it absolutely is not clear this is how it works or whether its a bug.

andrasbacsai commented 2 months ago

Coolify dev here. In v4.0.0-beta.314, there will be a one-click service for Plane.