2.1 KiB
2.1 KiB
Deployment Guide for Coolify
This repository is optimized for deployment on Coolify using Docker or Docker Compose.
Quick Deployment Options in Coolify
Option A: Deployment via Git Repository (Recommended)
- Push Code to Git: Push this repository to GitHub, GitLab, or your self-hosted Git service.
- Add New Resource in Coolify:
- Go to your Coolify dashboard.
- Click + Add Resource -> Public Repository or Private Repository.
- Paste your repository URL and select the
mainbranch.
- Select Build Pack:
- Select Dockerfile. Coolify will automatically detect the
Dockerfilein the root directory.
- Select Dockerfile. Coolify will automatically detect the
- Configure Port & Network:
- Port: Set
3000.
- Port: Set
- Configure Persistent Volume:
- Under Storage / Volumes, add a persistent volume mapping to prevent data loss on container redeployments:
- Destination Path:
/app/data
- Destination Path:
- Under Storage / Volumes, add a persistent volume mapping to prevent data loss on container redeployments:
- Deploy:
- Click Deploy. Coolify will build the multi-stage Docker image and start your application.
Option B: Deployment via Docker Compose
- Add New Resource in Coolify:
- Click + Add Resource -> Docker Compose.
- Source Code:
- Select your Git Repository or paste the contents of
docker-compose.yml.
- Select your Git Repository or paste the contents of
- Environment Variables:
- Add the following environment variables in Coolify UI:
NODE_ENV=production PORT=3000 DATA_PATH=/app/data/portal-data.json
- Add the following environment variables in Coolify UI:
- Deploy:
- Click Deploy. Coolify will spin up the container and attach the
portal_datavolume automatically.
- Click Deploy. Coolify will spin up the container and attach the
Local Testing with Docker
To build and test locally before deploying to Coolify:
Using Docker Compose:
docker-compose up --build -d
Access the app at: http://localhost:3000
Using Docker directly:
docker build -t balance-sheet-portal .
docker run -p 3000:3000 -v portal_data:/app/data balance-sheet-portal
Health Check Endpoint
The container includes a built-in health check targeting:
GET /api/health
It returns {"status": "ok"} when the Express server and Vite static engine are healthy.