Files
gw-svelte/mail-api/Dockerfile
T
2026-05-26 08:30:08 +12:00

37 lines
1.1 KiB
Docker

ARG APP_VERSION=4.0.1
FROM python:3.12-slim
ARG APP_VERSION
WORKDIR /app
ENV APP_VERSION=${APP_VERSION}
ENV TZ=Pacific/Auckland
LABEL org.opencontainers.image.version="${APP_VERSION}"
COPY requirements.txt .
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
tzdata \
libpango-1.0-0 \
libpangoft2-1.0-0 \
libharfbuzz0b \
libfribidi0 \
libcairo2 \
shared-mime-info \
fonts-dejavu-core \
fonts-liberation \
&& rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py db.py ./
COPY mail_api ./mail_api
# Legacy clients seed, generated by scripts/build-legacy-seed.mjs (called from
# deploy.ps1). Lives OUTSIDE the data volume so every deploy carries a fresh
# copy. The mail-api merges this on boot, add-only — it never overwrites a
# live entry. Must always be present in the build context; for local dev run
# `node scripts/build-legacy-seed.mjs` once, or `echo {} > legacy-clients-seed.json`.
COPY legacy-clients-seed.json /app/legacy-clients-seed.json
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]