mirror of
https://github.com/taogaetz/chefbible.git
synced 2025-12-06 11:47:24 -05:00
1.8 KiB
1.8 KiB
Chef Bible - Docker Deployment
Portainer Deployment
This application is designed to be deployed on Portainer with SQLite database persistence.
Environment Variables
Set these environment variables in Portainer:
Required:
NODE_ENV=production
DATABASE_URL=file:/app/data/database.db
ORIGIN=https://birba.redbackpack.ca
Optional (for photo uploads):
CLOUDINARY_URL=cloudinary://api_key:api_secret@cloud_name
Note: If CLOUDINARY_URL is not provided, photo uploads will be disabled but the application will still function normally.
Volume Mounts
Create a volume mount for database persistence:
- Host Path:
/var/lib/docker/volumes/chef-bible-data/_data - Container Path:
/app/data - Type: Bind Mount or Named Volume
Port Configuration
- Container Port: 3000
- Host Port: 80 (or your preferred port)
- Protocol: HTTP
Docker Build
To build the image locally:
docker build -t chef-bible .
Database Initialization
The application will automatically:
- Create the SQLite database on first run
- Run Prisma migrations
- Seed the database with initial recipes
Health Check
The container includes a health check endpoint at /health that Portainer can use to monitor the application status.
Security Notes
- The application runs as a non-root user (
sveltekit) - Database files are stored in a persistent volume
- Environment variables are used for configuration
- No sensitive data is hardcoded
Backup
To backup the database:
# Copy the database file from the volume
docker cp <container_id>:/app/data/database.db ./backup-$(date +%Y%m%d).db
Updates
To update the application:
- Build new image with updated code
- Deploy new container in Portainer
- Database will persist through updates via volume mount