1.4 KiB
1.4 KiB
🐳 Self-Hosting with Docker (CasaOS)
You can easily host this Calorie Tracker on your home server using Docker or CasaOS.
🛠️ Quick Setup for CasaOS
-
Download the files:
- Download
docker-compose.yml - Download the
calorie_tracker_appfolder
- Download
-
Import to CasaOS:
- Open CasaOS Dashboard
- Click + (Install a customized app)
- Click Import (top right)
- Select the
docker-compose.ymlfile - (Optional) Setup the
API_NINJAS_KEYin the Settings
-
Install:
- Click Install
- The app will start at
http://your-server-ip:5001
🐳 Manual Docker Compose
-
Navigate to the project directory:
cd calorie_tracker -
Run with Docker Compose:
docker-compose up -d --build -
Access the app:
- Open
http://localhost:5001
- Open
💾 Data Persistence
- Database is stored in
./data/calorie_tracker.dbon your host machine. - This ensures your data survives container restarts/updates.
⚙️ Environment Variables
You can configure these in docker-compose.yml or CasaOS settings:
| Variable | Description | Default |
|---|---|---|
API_NINJAS_KEY |
Key for nutrition API | (Empty) |
SECRET_KEY |
Flask secret key | change-this... |
DATABASE_URL |
Database path | sqlite:////app/data/calorie_tracker.db |