Skip to content

Commit

Permalink
fix(Dockerfile): fix venv
Browse files Browse the repository at this point in the history
  • Loading branch information
foosinn committed Feb 4, 2025
1 parent efb274f commit 4691ae0
Showing 1 changed file with 7 additions and 19 deletions.
26 changes: 7 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
FROM python:3.10-slim-bullseye AS poetry

RUN true \
&& pip install poetry

WORKDIR /app
COPY . /app

RUN poetry build

# ---

FROM python:3.10-slim-bullseye AS env

WORKDIR /app

RUN apt-get update
RUN apt-get install -y libldap2-dev build-essential libsasl2-dev libmariadb-dev pkg-config
RUN python -m venv env
RUN /app/env/bin/pip install gunicorn whitenoise
RUN pip install poetry poetry-plugin-bundle

WORKDIR /app
COPY . /app

COPY --from=poetry /app/dist/ ./
RUN /app/env/bin/pip install /app/lgr-*.whl
RUN poetry add gunicorn whitenoise
RUN poetry bundle venv env

# ---

Expand All @@ -37,4 +25,4 @@ COPY --from=env /app /app
ENV IN_DOCKER=True
ENV CONFIG_DIR=/config
EXPOSE 8000
CMD /app/env/bin/gunicorn -w 4 -b 0.0.0.0:8000 lgr.wsgi:application
CMD /app/env/bin/python /app/env/bin/gunicorn -w 4 -b 0.0.0.0:8000 lgr.wsgi:application

0 comments on commit 4691ae0

Please sign in to comment.