Skip to content

Conversation

zehjotkah
Copy link

@zehjotkah zehjotkah commented Sep 16, 2025

Changes

  • added rybbit service template

Issues

Copy link
Member

@ShadowArcanist ShadowArcanist left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @zehjotkah, thanks for the PR!

This looks great, especially for your first PR on GitHub. Definitely better than most service template PRs I’ve seen!

I’ve left a few suggestions to improve the service compose, so please check those out when you get a chance.

Also, it seems like this hasn't been tested yet (based on your comment here. If that’s the case, could you please test it thoroughly and let us know?

Additionally, it would be awesome if you could add a PR to the docs repo here: coolify-docs. You can take a look at this PR for an idea of which files to edit or add.

- 'NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP:-false}'
depends_on:
- rybbit_backend
restart: unless-stopped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds restart policy automatically so this is not needed

Suggested change
restart: unless-stopped

Comment on lines 136 to 138
volumes:
postgres_data:
clickhouse_data:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds this automatically so this is not needed

Suggested change
volumes:
postgres_data:
clickhouse_data:

timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds restart policy automatically so this is not needed

Suggested change
restart: unless-stopped

interval: 30s
timeout: 10s
retries: 3
restart: unless-stopped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds restart policy automatically so this is not needed

Suggested change
restart: unless-stopped


rybbit_clickhouse:
image: 'clickhouse/clickhouse-server:25.4.2'
container_name: rybbit-clickhouse
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds container names automatically so this is not needed

Suggested change
container_name: rybbit-clickhouse

services:
rybbit:
image: 'ghcr.io/rybbit-io/rybbit-client:latest'
container_name: rybbit-client
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds container names automatically so this is not needed

Suggested change
container_name: rybbit-client

timeout: 10s
retries: 3
start_period: 10s
restart: unless-stopped
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coolify adds restart policy automatically so this is not needed

Suggested change
restart: unless-stopped

Comment on lines 35 to 36
- CLICKHOUSE_USER=default
- CLICKHOUSE_DB=analytics
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the user and db is already hard coded on rybbit_clickhouse service we don't have to hard code it here (in future if we need to change these value we just need to change in one place)

Suggested change
- CLICKHOUSE_USER=default
- CLICKHOUSE_DB=analytics
- CLICKHOUSE_USER=${CLICKHOUSE_USER}
- CLICKHOUSE_DB=${CLICKHOUSE_DB}

Comment on lines 39 to 40
- POSTGRES_DB=analytics
- POSTGRES_USER=frog
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the user and db is already hard coded on rybbit_postgres service we don't have to hard code it here (in future if we need to change these value we just need to change in one place)

Suggested change
- POSTGRES_DB=analytics
- POSTGRES_USER=frog
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}

Comment on lines 11 to 14
environment:
- NODE_ENV=production
- 'NEXT_PUBLIC_BACKEND_URL=${SERVICE_URL_RYBBIT}'
- 'NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP:-false}'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The port: 3000 mentioned on the comments at the top of the compose is useful for users who are using caddy as their Coolify Proxy but those who use traefik as their Coolify Proxy might see no available server error because of the missing SERVICE_URL_RYBBIT_3000

The SERVICE_URL_RYBBIT_3000 also tells Coolify to automatically generate a sub domain for the service with port 3000 at the end so the user just have to change the domain to the domain they prefer to use but the auto generated domain will work out of the box (if they have DNS configured properly to resolve all of their sub domains to the server where they are deploying this service)

Suggested change
environment:
- NODE_ENV=production
- 'NEXT_PUBLIC_BACKEND_URL=${SERVICE_URL_RYBBIT}'
- 'NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP:-false}'
environment:
- SERVICE_URL_RYBBIT_3000
- NODE_ENV=production
- 'NEXT_PUBLIC_BACKEND_URL=${SERVICE_URL_RYBBIT}'
- 'NEXT_PUBLIC_DISABLE_SIGNUP=${DISABLE_SIGNUP:-false}'

- fixed port
- removed unnecessary stuff (container_name, restart)
- added client/frontend healthcheck
- DRY for hardcoded values
@zehjotkah
Copy link
Author

Thanks, I updated the yaml with your suggestions. Thanks for teaching me.
Also I fixed the port and added a health check for the frontend.
Do you know a way to add the generated frontend URL also to the backend but add /api?
Yes, I tested it. Just thought that others might want to test it, too.

@zehjotkah
Copy link
Author

added pull request for the docs:
coollabsio/coolify-docs#363

@ShadowArcanist
Copy link
Member

Thanks, I updated the yaml with your suggestions. Thanks for teaching me. Also I fixed the port and added a health check for the frontend. Do you know a way to add the generated frontend URL also to the backend but add /api? Yes, I tested it. Just thought that others might want to test it, too.

Cool!

To set the backend URL with the /api path, you can use:

- BACKEND_URL=$SERVICE_URL_FRONTEND/api

This appends /api to the auto-generated frontend URL and assigns it to the BACKEND_URL environment variable. It's a good approach because if the user changes the domain via the UI, the backend URL will automatically update to reflect that change.

I put together a quick Docker Compose file to test this setup:

services:
  frontend:
    image: 'nginx:alpine'
    environment:
      - SERVICE_URL_FRONTEND_3000
    command: >
      /bin/sh -c "echo \"Frontend URL: $SERVICE_URL_FRONTEND_3000\" && nginx -g 'daemon off;'"

  backend:
    image: 'nginx:alpine'
    environment:
      - BACKEND_URL=$SERVICE_URL_FRONTEND/api
    command: >
      /bin/sh -c "echo \"Backend URL: $BACKEND_URL\" && nginx -g 'daemon off;'"

And here’s the log output showing the value of the environment variable:
image

I only configured the domain for the frontend service in the UI:
image

@zehjotkah
Copy link
Author

zehjotkah commented Sep 18, 2025

Thanks, this unfortunately doesn't work for Rybbit.
There is some kind of problem with the prefixes, so it seems we need to set the backend URL via Coolify's UI and uncheck the "strip prefixes" checkbox.
But I documented it in the service template docs. It's nearly a one click deploy. The user only has to set both URLs. Maybe @goldflag has some details on how to solve this.

@ShadowArcanist ShadowArcanist added the ⚙️ Service Issues requesting or PRs adding/fixing service templates. label Sep 25, 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants