25 lines
814 B
Docker
25 lines
814 B
Docker
FROM python:3.12-slim
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
|
|
# WeasyPrint needs Pango; DejaVu fonts give the reports a consistent look.
|
|
RUN apt-get update \
|
|
&& apt-get install -y --no-install-recommends libpango-1.0-0 libpangoft2-1.0-0 libharfbuzz-subset0 \
|
|
fonts-dejavu-core \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /srv
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY alembic.ini .
|
|
COPY alembic ./alembic
|
|
COPY app ./app
|
|
COPY docker-entrypoint.sh .
|
|
RUN chmod +x docker-entrypoint.sh && useradd --system --uid 1000 app && chown -R app /srv
|
|
USER app
|
|
|
|
EXPOSE 8000
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/health')"
|
|
ENTRYPOINT ["./docker-entrypoint.sh"]
|