From 48cf7e8e9075f964a61b86d0f45493e7931d41be Mon Sep 17 00:00:00 2001 From: Klaas van Schelven Date: Wed, 30 Jul 2025 22:33:04 +0200 Subject: [PATCH] Docker.fromwheel: more completely _from wheel_ Before this commit, the COPY command was still used to copy-over 2 files from the working dir. Alhtough this was probably fine in practice (docker build typically happens from a checked out state that matches the wheel you're docker-building) it's not what's on the tin ("from wheel") and it opens up the possiblity of subtle bugs (file mismatches when building from a different state). Better prevent those. --- Dockerfile | 2 +- Dockerfile.fromwheel | 4 ++-- gunicorn.docker.conf.py => bugsink/gunicorn.docker.conf.py | 0 3 files changed, 3 insertions(+), 3 deletions(-) rename gunicorn.docker.conf.py => bugsink/gunicorn.docker.conf.py (100%) diff --git a/Dockerfile b/Dockerfile index cc52519..3f75992 100644 --- a/Dockerfile +++ b/Dockerfile @@ -51,4 +51,4 @@ RUN ["bugsink-manage", "migrate", "snappea", "--database=snappea"] HEALTHCHECK CMD python -c 'import requests; requests.get("http://localhost:8000/health/ready").raise_for_status()' -CMD [ "monofy", "bugsink-manage", "check", "--deploy", "--fail-level", "WARNING", "&&", "bugsink-manage", "migrate", "&&", "bugsink-manage", "prestart", "&&", "gunicorn", "--config", "gunicorn.docker.conf.py", "--bind=0.0.0.0:$PORT", "--access-logfile", "-", "bugsink.wsgi", "|||", "bugsink-runsnappea"] +CMD [ "monofy", "bugsink-manage", "check", "--deploy", "--fail-level", "WARNING", "&&", "bugsink-manage", "migrate", "&&", "bugsink-manage", "prestart", "&&", "gunicorn", "--config", "bugsink/gunicorn.docker.conf.py", "--bind=0.0.0.0:$PORT", "--access-logfile", "-", "bugsink.wsgi", "|||", "bugsink-runsnappea"] diff --git a/Dockerfile.fromwheel b/Dockerfile.fromwheel index 69c5aad..0b7237c 100644 --- a/Dockerfile.fromwheel +++ b/Dockerfile.fromwheel @@ -70,8 +70,8 @@ COPY dist/$WHEEL_FILE /wheels/ RUN --mount=type=cache,target=/var/cache/buildkit/pip \ pip install /wheels/$WHEEL_FILE -COPY bugsink/conf_templates/docker.py.template bugsink_conf.py -COPY gunicorn.docker.conf.py /app/ +RUN cp /usr/local/lib/python3.12/site-packages/bugsink/conf_templates/docker.py.template /app/bugsink_conf.py && \ + cp /usr/local/lib/python3.12/site-packages/bugsink/gunicorn.docker.conf.py /app/gunicorn.docker.conf.py RUN ["bugsink-manage", "migrate", "snappea", "--database=snappea"] diff --git a/gunicorn.docker.conf.py b/bugsink/gunicorn.docker.conf.py similarity index 100% rename from gunicorn.docker.conf.py rename to bugsink/gunicorn.docker.conf.py