51 lines
1.4 KiB
Markdown
51 lines
1.4 KiB
Markdown
# 🐳 Self-Hosting with Docker (CasaOS)
|
|
|
|
You can easily host this Calorie Tracker on your home server using Docker or CasaOS.
|
|
|
|
## 🛠️ Quick Setup for CasaOS
|
|
|
|
1. **Download the files**:
|
|
* Download `docker-compose.yml`
|
|
* Download the `calorie_tracker_app` folder
|
|
|
|
2. **Import to CasaOS**:
|
|
* Open CasaOS Dashboard
|
|
* Click **+** (Install a customized app)
|
|
* Click **Import** (top right)
|
|
* Select the `docker-compose.yml` file
|
|
* (Optional) Setup the `API_NINJAS_KEY` in the Settings
|
|
|
|
3. **Install**:
|
|
* Click **Install**
|
|
* The app will start at `http://your-server-ip:5001`
|
|
|
|
## 🐳 Manual Docker Compose
|
|
|
|
1. Navigate to the project directory:
|
|
```bash
|
|
cd calorie_tracker
|
|
```
|
|
|
|
2. Run with Docker Compose:
|
|
```bash
|
|
docker-compose up -d --build
|
|
```
|
|
|
|
3. Access the app:
|
|
* Open `http://localhost:5001`
|
|
|
|
## 💾 Data Persistence
|
|
|
|
* Database is stored in `./data/calorie_tracker.db` on 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` |
|