SBF Innovation Lab Wiki
Deployment

Coolify

Deploy an app with Coolify

Terms

TermMeaning
ServerThe Tencent Cloud VPS, registered in Coolify
ProjectA group of related resources
EnvironmentUsually production and staging inside a project
ResourceAn app, a database, or a service
SourceWhere the code comes from. Here: GitHub
Build packHow Coolify builds the app: Nixpacks, Dockerfile, or Docker Compose
DomainThe public URL. Coolify adds HTTPS

Projects

ProjectUse for
ResearchTests and experiments. Deploy every new app here first.
AppsInternal applications, after testing and approval.
ServicesInternal services, after testing and approval.

Research is only for testing. Do not put anything there that must stay online.

Deploy a new app

Open https://cp.superbonfire.tech.

  1. Open the Research project.
  2. Click + New → Public / Private Repository (GitHub App). Select the superbonfire-lab organisation, the repository, and the main branch. The GitHub App is already installed. Do not make a second one.
  3. Select the build pack:
    • The repository has a Dockerfile → Dockerfile.
    • The repository has a docker-compose.yml → Docker Compose.
    • Neither → Nixpacks. It detects Node, Python, and other stacks.
  4. Set the port the app listens on inside the container, for example 3000, 8000, or 80.
  5. Set the domain: https://app-name.cp.superbonfire.tech. See DNS.
  6. Add the environment variables. Mark secrets as hidden. Copy the names from .env.example. Get the values from Vaultwarden.
  7. Click Deploy and watch the build logs. A good deploy shows Running.
  8. Turn on Auto Deploy, so every push to main redeploys the app. Check the webhook in the repository under Settings → Webhooks.
  9. Open the URL and check the logs for errors.

Move to Apps or Services

  1. Test the app in Research. Check that it works and the logs are clean.
  2. Move the resource to Apps or Services. If you cannot find a move option, deploy the same repository in the target project.
  3. Check that the new copy works.
  4. Ask Syahman before you delete the Research copy, so names do not clash and old resources do not pile up.

Roll back

Open the resource → Deployments → select the last good deployment → Redeploy. Or revert the bad commit on main and push.

Examples

Dockerfile (Node.js)

Use this if the repository has no Dockerfile:

FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY . .
EXPOSE 3000
CMD ["node", "server.js"]

.env.example

Commit .env.example. Never commit .env.

# Copy to .env for local development. On Coolify, set these in the dashboard.
DATABASE_URL=
API_KEY=
NODE_ENV=production
PORT=3000

On this page