mirror of
https://github.com/jlengrand/bugsink.git
synced 2026-03-10 08:01:17 +00:00
'for good measure'; I've seen this before and remembered it (i.e. I have not actually observed a need for it this time). https://stackoverflow.com/a/59812588/339144
36 lines
1.1 KiB
Docker
36 lines
1.1 KiB
Docker
ARG PYTHON_VERSION=3.12
|
|
|
|
# Build image: non-slim, in particular to build the mysqlclient wheel
|
|
FROM python:${PYTHON_VERSION} AS build
|
|
|
|
ARG WHEEL_FILE=wheelfile-not-specified.whoops
|
|
|
|
COPY dist/$WHEEL_FILE /wheels/
|
|
RUN --mount=type=cache,target=/var/cache/buildkit/pip \
|
|
pip wheel --wheel-dir /wheels /wheels/${WHEEL_FILE} mysqlclient
|
|
|
|
|
|
# Actual image (based on slim)
|
|
FROM python:${PYTHON_VERSION}-slim
|
|
|
|
# ARGs are not inherited from the build stage; https://stackoverflow.com/a/56748289/339144
|
|
ARG WHEEL_FILE
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
# mysqlclient dependencies; needed here too, because the built wheel depends on .o files
|
|
RUN apt update && apt install default-libmysqlclient-dev -y
|
|
|
|
COPY --from=build /wheels /wheels
|
|
RUN --mount=type=cache,target=/var/cache/buildkit/pip \
|
|
pip install --find-links /wheels --no-index /wheels/$WHEEL_FILE mysqlclient
|
|
|
|
COPY bugsink_conf.py .
|
|
|
|
RUN ["bugsink-manage", "migrate", "snappea", "--database=snappea"]
|
|
|
|
EXPOSE 9000
|
|
|
|
CMD [ "bugsink-server-unified", "gunicorn", "--bind=0.0.0.0:9000", "--workers=10", "--access-logfile", "-", "bugsink.wsgi", "UNIFIED_WITH", "bugsink-runsnappea"]
|