A local nutrition tracking app powered by AI
YuHeng is designed for easy deployment using Docker with PostgreSQL. The application automatically runs database migrations on startup.
The application is built using a multi-stage Dockerfile based on oven/bun:1-alpine for maximum performance and the smallest possible production footprint. It uses Next.js standalone output for efficiency and is natively built for linux/arm64 using GitHub’s native ARM runners.
| Variable | Description | Default |
|---|---|---|
PORT |
The port the server listens on | 3000 |
DATABASE_URL |
PostgreSQL connection string | (Required) |
The Docker image includes an entrypoint script that automatically handles database migrations on startup:
node-pg-migrateThis ensures your database schema is always up-to-date without manual intervention.
The default docker-compose.yml uses the pre-built image from GitHub Container Registry for quick deployment:
docker-compose up -d
This will:
ghcr.io/formaxcn/yuheng:latest imageFor development or custom builds, use docker-compose.local.yml to build the image locally:
docker-compose -f docker-compose.local.yml up -d
This will:
For simple deployments, you can use docker run directly:
docker run -d \
--name yuheng \
-p 3000:3000 \
-e DATABASE_URL=postgresql://user:password@your-db-host:5432/yuheng \
-v ./data:/app/data \
ghcr.io/formaxcn/yuheng
nextjs user (UID 1001) for improved security.docker-compose.yml includes a health check for the database to ensure smooth startup.tini as PID 1 to properly handle signals and prevent zombie processes.