diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..755f4ee --- /dev/null +++ b/.dockerignore @@ -0,0 +1,8 @@ +.env +.venv/ +__pycache__/ +*.pyc +.git/ +.pytest_cache/ +.ruff_cache/ +tests/ diff --git a/.gitea/workflows/pipeline.yml b/.gitea/workflows/pipeline.yml index 03d121d..7916f9c 100644 --- a/.gitea/workflows/pipeline.yml +++ b/.gitea/workflows/pipeline.yml @@ -47,23 +47,23 @@ jobs: steps: - uses: actions/checkout@v4 - name: Build Docker image - run: docker build -t gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} . + run: docker build -t gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} . - name: Trivy scan uses: aquasecurity/trivy-action@master with: - image-ref: gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} + image-ref: gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} severity: CRITICAL,HIGH exit-code: "1" # laat de pipeline falen bij kritieke kwetsbaarheden - name: Login bij Gitea-registry - run: echo "${{ secrets.GLUCOSE_TOKEN }}" | docker login gitea.thuis.local -u willem --password-stdin + run: echo "${{ secrets.GLUCOSE_TOKEN }}" | docker login gitea.zb.local -u willem --password-stdin - name: Tag en push run: | - docker tag gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} gitea.thuis.local/willem/glucose-dashboard:latest - docker push gitea.thuis.local/willem/glucose-dashboard:${{ gitea.sha }} - docker push gitea.thuis.local/willem/glucose-dashboard:latest + docker tag gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} gitea.zb.local/willem/glucose-dashboard:latest + docker push gitea.zb.local/willem/glucose-dashboard:${{ gitea.sha }} + docker push gitea.zb.local/willem/glucose-dashboard:latest # --------------------------------------------------------------------- # 4. Deploy — SSH naar de LXC en herstart met de nieuwe image diff --git a/.gitignore b/.gitignore index edc638d..21e5d76 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ __pycache__/ .env .pytest_cache/ .ruff_cache/ +homelab-cicd-werkinstructie.md \ No newline at end of file diff --git a/README.md b/README.md index 2f49329..439c486 100644 --- a/README.md +++ b/README.md @@ -10,14 +10,15 @@ koolhydraten en pomp-/sensorwissels overlay, plus time-in-range-cijfers. > Manage Tokens in Nightscout — geef het token minimaal `readable`-rechten) of het klassieke API secret. 2. Kopieer `.env.example` naar `.env` en vul `NIGHTSCOUT_URL` en één van de - twee auth-opties in. + twee auth-opties in. `app.py` laadt `.env` zelf in (via `python-dotenv`), + dus dit werkt hetzelfde onder PowerShell, cmd of bash — je hoeft de + variabelen niet zelf in je shell te zetten. 3. Lokaal draaien: - ```bash + ```powershell uv venv - uv pip install -r requirements.txt - set -a; source .env; set +a # of: laad de vars op je eigen manier - streamlit run app.py + uv pip install -r requirements.txt --python .venv + .venv\Scripts\streamlit run app.py ``` 4. Met Docker Compose: diff --git a/docker-compose.yml b/docker-compose.yml index 44a0906..d840770 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: glucose-dashboard: - image: gitea.thuis.local/willem/glucose-dashboard:latest + image: gitea.zb.local/willem/glucose-dashboard:latest container_name: glucose-dashboard restart: unless-stopped ports: