5.2 KiB
Deployment Guide (Coolify)
This guide provides two supported deployment paths for Arbitrade on Coolify:
- Build directly from Git repository in Coolify.
- Deploy prebuilt container image:
git.allucanget.biz/allucanget/arbitrade:latest.
Reference docs:
- Coolify Applications: https://coolify.io/docs/applications
- Coolify Build Packs: https://coolify.io/docs/applications/build-packs
- Coolify Dockerfile Build Pack: https://coolify.io/docs/applications/build-packs/dockerfile
- Coolify Nixpacks Build Pack: https://coolify.io/docs/applications/build-packs/nixpacks
- Coolify CI/CD (Git providers): https://coolify.io/docs/applications/ci-cd
- Coolify Gitea integration: https://coolify.io/docs/applications/ci-cd/gitea/integration
- Coolify environment variables: https://coolify.io/docs/knowledge-base/environment-variables
- Coolify persistent storage: https://coolify.io/docs/knowledge-base/persistent-storage
- Coolify health checks: https://coolify.io/docs/knowledge-base/health-checks
- Coolify Docker registry credentials: https://coolify.io/docs/knowledge-base/docker/registry
Common Runtime Configuration
Use these values in both deployment modes.
Port and health
- Container port:
9090 - Health check path:
/health - Protocol: HTTP
Persistent storage
- Add a persistent volume
- Mount path:
/app/data - Set DB path to:
DUCKDB_PATH=/app/data/arbitrade.duckdb
Required environment variables
APP_ENV=prodAPP_HOST=0.0.0.0APP_PORT=9090DUCKDB_PATH=/app/data/arbitrade.duckdbLOG_LEVEL=INFOLOG_JSON=trueKRAKEN_API_KEY=<set-in-coolify-secret>KRAKEN_API_SECRET=<set-in-coolify-secret>KRAKEN_API_KEY_PERMISSIONS=query,tradeFERNET_KEY=<set-in-coolify-secret>
Notes:
- Store secrets in Coolify secret variables, not in Git.
- Keep Kraken key scope minimal (query + trade, no withdrawal).
Option A: Build in Coolify from Git Repository
Recommended when you want Coolify to build from source and optionally auto-deploy on commits.
-
Open your Coolify project and select Create New Resource.
-
Choose deployment source:
- Public repo: use
Public repositoryand provide HTTPS URL. - Private Gitea repo: use deploy key flow from the Gitea guide.
- Public repo: use
-
Set repository URL for this project:
https://git.allucanget.biz/allucanget/arbitrade.git(public)- or SSH URL if private deploy key is used.
-
Choose build pack:
- Prefer
Dockerfilefor this repo, because Docker build behavior is explicitly defined. - Use
Nixpacksonly if you intentionally want auto-detected build logic.
- Prefer
-
Configure branch and base directory:
- Branch: your deploy branch (for example
main) - Base directory:
/
- Branch: your deploy branch (for example
-
Configure network:
- Exposed port:
9090 - Domain: set your Coolify domain/custom domain
- Exposed port:
-
Configure environment variables and secrets from the Common Runtime Configuration section.
-
Add persistent storage mount
/app/data. -
Configure health check:
- Path:
/health - Ensure container includes
curlorwgetif using UI-defined checks.
- Path:
-
Click Deploy and verify:
- Deployment logs complete successfully.
GET /healthreturns success.
Optional (Git webhook auto-deploy with Gitea):
- In Coolify resource, open
Webhooksand copy Manual Git Webhook URL. - Set webhook secret in Coolify.
- In Gitea repo settings, add webhook URL + same secret and enable Push events.
- Push a commit and confirm Coolify triggers deploy.
Option B: Deploy Prebuilt Image from Container Registry
Recommended when CI publishes the image and Coolify only runs it.
Image:
git.allucanget.biz/allucanget/arbitrade:latest
-
Ensure CI publishes the image before first deployment.
-
In Coolify, select Create New Resource.
-
Choose Application deployment based on Docker Image.
-
Set image reference:
- Registry:
git.allucanget.biz - Image:
git.allucanget.biz/allucanget/arbitrade:latest
- Registry:
-
Configure registry credentials in Coolify if your registry requires auth.
-
Leave build/install/start commands empty unless you need overrides.
-
Set network and health:
- Exposed port:
9090 - Health check path:
/health
- Exposed port:
-
Add environment variables and secrets from the Common Runtime Configuration section.
-
Add persistent storage mount
/app/data. -
Deploy and verify:
- Logs show container start success.
GET /healthreturns success.
Update flow for new releases:
- Push code and let CI publish a new
latestimage. - Trigger redeploy in Coolify for this resource.
Quick Troubleshooting
No available serverfrom proxy:- Check health check path/port and app bind (
APP_HOST=0.0.0.0,APP_PORT=9090). - Verify health check is passing in Coolify.
TemplateNotFound: dashboard.htmlat runtime:- Ensure the deployed image/wheel includes package templates under
arbitrade/web/templates/*. - If you build from source, do not remove packaged template files under
src/arbitrade/web/templates. - DB resets after deploy:
- Confirm persistent mount exists at
/app/dataandDUCKDB_PATHpoints there. - Registry pull fails:
- Re-check Docker registry credentials in Coolify.
- App starts but unavailable externally:
- Confirm exposed port is
9090and domain is attached to this resource.