From 219003dffb4f571ec2a69f455b162a98f0abed3d Mon Sep 17 00:00:00 2001 From: agentbox Date: Sat, 1 Aug 2026 05:52:12 +0000 Subject: [PATCH] Replace Dockerfile and docker-compose.yml with .meal versions, update references --- Dockerfile | 30 ++++++++++++++++++++++-------- Dockerfile.meal | 24 ------------------------ docker-compose.meal.yml | 22 ---------------------- docker-compose.yml | 29 +++++++++++++++++------------ watch-for-updates.sh | 2 +- 5 files changed, 40 insertions(+), 67 deletions(-) delete mode 100644 Dockerfile.meal delete mode 100644 docker-compose.meal.yml diff --git a/Dockerfile b/Dockerfile index a5929d2..6efbb1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,24 @@ -FROM node:latest -WORKDIR /workdir +FROM python:3.13-alpine -RUN apt update && \ - apt install -y git bash docker-cli && \ - npm install -g --ignore-scripts @earendil-works/pi-coding-agent && \ - pi install npm:pi-subagents +WORKDIR /app -COPY * /workdir/ -ENTRYPOINT ["sleep", "infinity"] +# Install dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt + +# Copy application +COPY app.py models.py auth.py meals.py ./ +COPY templates/ templates/ +COPY static/ static/ + +# Create persistent data directory +RUN mkdir -p /data +ENV DB_PATH=/data/meals.db + +EXPOSE 5000 + +# Generate a default secret key at build time (override in prod) +ENV SECRET_KEY=change-me-in-production + +# Run in production mode (no debug, use a WSGI server) +CMD ["flask", "--app", "app:create_app()", "run", "--host=0.0.0.0", "--port=5000"] diff --git a/Dockerfile.meal b/Dockerfile.meal deleted file mode 100644 index 6efbb1c..0000000 --- a/Dockerfile.meal +++ /dev/null @@ -1,24 +0,0 @@ -FROM python:3.13-alpine - -WORKDIR /app - -# Install dependencies -COPY requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt - -# Copy application -COPY app.py models.py auth.py meals.py ./ -COPY templates/ templates/ -COPY static/ static/ - -# Create persistent data directory -RUN mkdir -p /data -ENV DB_PATH=/data/meals.db - -EXPOSE 5000 - -# Generate a default secret key at build time (override in prod) -ENV SECRET_KEY=change-me-in-production - -# Run in production mode (no debug, use a WSGI server) -CMD ["flask", "--app", "app:create_app()", "run", "--host=0.0.0.0", "--port=5000"] diff --git a/docker-compose.meal.yml b/docker-compose.meal.yml deleted file mode 100644 index c4618c0..0000000 --- a/docker-compose.meal.yml +++ /dev/null @@ -1,22 +0,0 @@ -services: - meal-tracker: - build: - context: . - dockerfile: Dockerfile.meal - ports: - - "5000:5000" - volumes: - - meal-data:/data - environment: - - SECRET_KEY=${SECRET_KEY:-change-me-in-production} - restart: unless-stopped - hostname: meal-tracker - networks: - - caddy - -volumes: - meal-data: - -networks: - caddy: - external: true diff --git a/docker-compose.yml b/docker-compose.yml index 1257422..ef356f6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,17 +1,22 @@ services: - dind: - image: docker:dind - restart: unless-stopped - privileged: true - environment: - DOCKER_TLS_CERTDIR: "" - agentbox: + meal-tracker: build: context: . dockerfile: Dockerfile + ports: + - "5000:5000" + volumes: + - meal-data:/data environment: - DOCKER_HOST: tcp://dind:2375 - depends_on: - dind: - condition: service_started - env_file: .env + - SECRET_KEY=${SECRET_KEY:-change-me-in-production} + restart: unless-stopped + hostname: meal-tracker + networks: + - caddy + +volumes: + meal-data: + +networks: + caddy: + external: true diff --git a/watch-for-updates.sh b/watch-for-updates.sh index d40bc5f..42bc6e5 100755 --- a/watch-for-updates.sh +++ b/watch-for-updates.sh @@ -17,7 +17,7 @@ if [ -z "${GITEA_PASSWORD:-}" ]; then fi # Configure the remote with credentials for non-interactive pulls -COMPOSE_FILE="docker-compose.meal.yml" +COMPOSE_FILE="docker-compose.yml" REMOTE_BASE="https://gitea.ct.cozytren.ch/romane/agentbox-test" REMOTE_AUTH="https://agentbox:${GITEA_PASSWORD}@gitea.ct.cozytren.ch/romane/agentbox-test" git remote set-url origin "$REMOTE_AUTH"