chore: unify packaging around uv

This commit is contained in:
Hadrian Burkhardt
2026-04-30 23:59:56 +00:00
parent b0fc264cb2
commit bfe72b4f77
17 changed files with 43 additions and 1310 deletions
+7 -6
View File
@@ -9,7 +9,7 @@ ARG DEPLOY_DIR
ARG USERNAME
# Install dependencies
RUN pip install pipenv
RUN pip install --no-cache-dir uv
# Add app user
RUN adduser --disabled-password ${USERNAME}
@@ -27,8 +27,9 @@ WORKDIR ${DEPLOY_DIR}
COPY stw_potsdam/ ./stw_potsdam
COPY tests ./tests
COPY Makefile .
COPY Pipfile .
COPY Pipfile.lock .
COPY README.md .
COPY pyproject.toml .
COPY uv.lock .
# Apply app user to app folder
RUN chown -R ${USERNAME} .
@@ -48,7 +49,7 @@ RUN apt-get update && apt-get install -y build-essential python3-dev
# Install environment
USER ${USERNAME}
RUN pipenv install --dev
RUN uv sync --frozen --extra dev
# Run tests
RUN make test
@@ -58,7 +59,7 @@ RUN rm -rf .venv
RUN rm -rf ./tests ./Makefile
# Install production environment
RUN pipenv install --deploy
RUN uv sync --frozen --no-dev
### Production container
@@ -82,6 +83,6 @@ ENV LISTEN_PORT=${LISTEN_PORT}
ENV LISTEN=0.0.0.0:${LISTEN_PORT}
EXPOSE ${LISTEN_PORT}
CMD ["pipenv", "run", "uwsgi", "--master", "--http11-socket", "$LISTEN", "--plugins", "python", "--protocol", "uwsgi", "--wsgi", "stw_potsdam.views:app", "--virtualenv", "./.venv"]
CMD ["sh", "-c", "uv run uwsgi --master --http11-socket \"$LISTEN\" --plugins python --protocol uwsgi --wsgi stw_potsdam.views:app --virtualenv ./.venv"]
HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://127.0.0.1:$LISTEN_PORT/health_check || exit 1