Fix Docker build

This commit is contained in:
f4lco
2026-03-11 20:45:56 +01:00
parent 68e092b06e
commit ef149a9114
+6 -6
View File
@@ -4,7 +4,7 @@ ARG LISTEN_PORT=3080
### Shared base container ### Shared base container
FROM python:3.13-alpine as basesys FROM python:3.13-slim AS basesys
ARG DEPLOY_DIR ARG DEPLOY_DIR
ARG USERNAME ARG USERNAME
@@ -12,7 +12,7 @@ ARG USERNAME
RUN pip install pipenv RUN pip install pipenv
# Add app user # Add app user
RUN adduser -D ${USERNAME} RUN adduser --disabled-password ${USERNAME}
# Create app folder # Create app folder
RUN mkdir -p ${DEPLOY_DIR} RUN mkdir -p ${DEPLOY_DIR}
@@ -38,13 +38,13 @@ USER ${USERNAME}
### Build & test container ### Build & test container
FROM basesys as buildsys FROM basesys AS buildsys
ARG DEPLOY_DIR ARG DEPLOY_DIR
ARG USERNAME ARG USERNAME
# Install required build dependencies # Install required build dependencies
USER root USER root
RUN apk add make gcc musl-dev linux-headers python3-dev RUN apt-get update && apt-get install -y build-essential python3-dev
# Install environment # Install environment
USER ${USERNAME} USER ${USERNAME}
@@ -70,7 +70,7 @@ ARG USERNAME
# Install dependencies # Install dependencies
USER root USER root
RUN apk add curl RUN apt-get update && apt-get install -y curl libpython3.13
# Copy built app # Copy built app
USER ${USERNAME} USER ${USERNAME}
@@ -82,6 +82,6 @@ ENV LISTEN_PORT=${LISTEN_PORT}
ENV LISTEN=0.0.0.0:${LISTEN_PORT} ENV LISTEN=0.0.0.0:${LISTEN_PORT}
EXPOSE ${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 ["pipenv", "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 HEALTHCHECK --interval=15s --timeout=3s CMD curl -f http://127.0.0.1:$LISTEN_PORT/health_check || exit 1