Files
ti/Dockerfile
Henrik Jess Nielsen 65a99d2138 feat(offers): live Lübeck offer prices with pick-to-list and deal matching
Fetch CITTI Lübeck offers from the Tjek API (German dealer 3czmZx only —
never the Danish Flensburg booklet) and surface them in the app.

- New offers + offer_meta tables; defensive hotspots parser; upsert by
  offer id, prune per re-fetched catalog while preserving picked rows
- Daily in-process refresh scheduler (data.db lives on the app's own
  Nomad alloc disk, so a separate periodic job can't share it) plus a
  manual POST /api/offers/refresh and an "Opdater" button
- /tilbud page: browse all offers by catalog, search, EUR + DKK, and tick
  offers onto the shopping list; picks appear in a Lübeck-tilbud section
  on the main list and check off as bought via the existing /api/price
- Match the fixed catalog items against current offers and show a
  "på tilbud" badge with the matched offer name (conservative word-
  boundary token match, >=2 tokens for multi-word names)
- Dockerfile: add ca-certificates for urllib HTTPS to the Tjek API
2026-10-30 10:35:43 +01:00

39 lines
813 B
Docker

FROM python:3.12-slim
ARG BUILD_VERSION=unknown
ARG BUILD_TIME=unknown
ARG GIT_COMMIT=unknown
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
FLASK_APP=app.py \
FLASK_ENV=production \
BUILD_VERSION=${BUILD_VERSION} \
BUILD_TIME=${BUILD_TIME} \
GIT_COMMIT=${GIT_COMMIT}
WORKDIR /app
# ca-certificates: urllib needs them to reach the Tjek API over HTTPS
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade --no-cache-dir pip
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY app.py .
COPY templates/ templates/
ENV DATA_DIR=/app/instance \
PORT=9756 \
HOST=0.0.0.0
RUN mkdir -p /app/instance
EXPOSE 9756
CMD ["sh", "-c", "python app.py"]