Deployment
Coolify
Deploy an app with Coolify
Terms
| Term | Meaning |
|---|---|
| Server | The Tencent Cloud VPS, registered in Coolify |
| Project | A group of related resources |
| Environment | Usually production and staging inside a project |
| Resource | An app, a database, or a service |
| Source | Where the code comes from. Here: GitHub |
| Build pack | How Coolify builds the app: Nixpacks, Dockerfile, or Docker Compose |
| Domain | The public URL. Coolify adds HTTPS |
Projects
| Project | Use for |
|---|---|
| Research | Tests and experiments. Deploy every new app here first. |
| Apps | Internal applications, after testing and approval. |
| Services | Internal 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.
- Open the Research project.
- Click + New → Public / Private Repository (GitHub App). Select the
superbonfire-laborganisation, the repository, and themainbranch. The GitHub App is already installed. Do not make a second one. - 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.
- The repository has a
- Set the port the app listens on inside the container, for example
3000,8000, or80. - Set the domain:
https://app-name.cp.superbonfire.tech. See DNS. - Add the environment variables. Mark secrets as hidden. Copy the names from
.env.example. Get the values from Vaultwarden. - Click Deploy and watch the build logs. A good deploy shows Running.
- Turn on Auto Deploy, so every push to
mainredeploys the app. Check the webhook in the repository under Settings → Webhooks. - Open the URL and check the logs for errors.
Move to Apps or Services
- Test the app in Research. Check that it works and the logs are clean.
- Move the resource to Apps or Services. If you cannot find a move option, deploy the same repository in the target project.
- Check that the new copy works.
- 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