Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New service OpenPanel #4728

Open
wants to merge 1 commit into
base: next
Choose a base branch
from
Open

New service OpenPanel #4728

wants to merge 1 commit into from

Conversation

sambeaCA
Copy link

@sambeaCA sambeaCA commented Jan 3, 2025

Changes

  • Add OpenPanel Service docker-compose file

Guide

Clone the repository to your VPS
git clone https://github.com/Openpanel-dev/openpanel && cd openpanel/self-hosting

Run the setup script

  • install node if your VPS doesn't already have it.
  • The script should detect docker assuming you already have Coolify installed.
cd openpanel/self-hosting
./setup

Unlike mentioned on the guide, I did not execute ./start

Edit /path/to/openpanel/self-hosting/.env file

NODE_ENV="production"
SELF_HOSTED="true"
GEO_IP_HOST="http://op-geo:8080"
BATCH_SIZE="5000"
BATCH_INTERVAL="10000"
REDIS_URL="redis://op-kv:6379"
CLICKHOUSE_URL="http://op-ch:8123/openpanel"
DATABASE_URL="postgresql://postgres:postgres@op-db:5432/postgres?schema=public"
DATABASE_URL_DIRECT="postgresql://postgres:postgres@op-db:5432/postgres?schema=public"
NEXT_PUBLIC_DASHBOARD_URL="https://example.com"
NEXT_PUBLIC_API_URL="https://example.com/api"
xxXXXxxxxXXXXxxxx="$COOKIE_SECRET"

Add a caddy file in Servers -> Proxy -> Dynamic Configurations

example.com {
    encode gzip
    
    handle_path /api* {
        reverse_proxy op-api:3000
    }
    reverse_proxy /* op-dashboard:3000
}
worker.example.com {
    encode gzip
    basic_auth {
        admin xxxxxxxxx
    }
    reverse_proxy op-worker:3000
}

Running service

  • Create a new resource and select Docker compose empty.
  • Paste in docker-compose file

Configure OP-API & OP-DASHBOARD services

OP-API Domain: https://example.com:3000/api
OP-DASHBOARD Domain: https://example.com:3000


Resource Screenshot

@lindesvard
Copy link

Not fully sure how coolify does things and I think this actually is related to App scaling discussion here.

But I would not hard code 5 workers since it will probably have worse performance than a single worker (if you don't have enough CPUs for it)

One worker should be fine in most self-hosting cases and I someone would need more they could increase this as needed.

@peaklabs-dev peaklabs-dev self-assigned this Jan 3, 2025
@peaklabs-dev
Copy link
Member

Thanks for the PR. Can you please use the Coolify magic envs as inline envs for all the env variables that are needed https://coolify.io/docs/knowledge-base/docker/compose#coolifys-magic-environment-variables and also please add a comment and logo to your PR https://coolify.io/docs/contribute/service.

Also the proxy stuff and setup script is not needed only when you are installing on a bare vps not inside Coolify.

@peaklabs-dev peaklabs-dev added ⚙️ Service Issues requesting or PRs adding/fixing service templates. 💤 Waiting for changes PRs awaiting changes from the author. labels Jan 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚙️ Service Issues requesting or PRs adding/fixing service templates. 💤 Waiting for changes PRs awaiting changes from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants