Skip to content

Commit

Permalink
Update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkrivich committed Dec 25, 2023
1 parent 72b23e4 commit 4c89a6a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8.3-alpine3.11 as base
FROM python:3.12-alpine as base
ENV PYTHONFAULTHANDLER=1 \
PYTHONHASHSEED=random \
PYTHONUNBUFFERED=1
Expand All @@ -9,11 +9,13 @@ FROM base as builder
ENV PIP_DEFAULT_TIMEOUT=100 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.0.5
POETRY_VERSION=1.7.1

RUN apk add --no-cache gcc libffi-dev musl-dev postgresql-dev
RUN pip install "poetry==$POETRY_VERSION"
RUN python -m venv /venv
RUN apk update && apk upgrade && \
apk add --no-cache gcc libffi-dev musl-dev postgresql-dev && \
python -m pip install --upgrade pip && \
pip install "poetry==$POETRY_VERSION" && \
python -m venv /venv

COPY pyproject.toml poetry.lock ./
RUN poetry export -f requirements.txt | /venv/bin/pip install -r /dev/stdin
Expand All @@ -22,9 +24,9 @@ COPY . .
RUN poetry build && /venv/bin/pip install dist/*.whl

FROM base as final
LABEL mainteiner="Maxim Krivich <maxkrivich@gmail.com>"
ENV PATH="/venv/bin:$PATH"
RUN apk add --no-cache libffi libpq
RUN apk update && apk upgrade \
&& apk add --no-cache libffi libpq
COPY --from=builder /venv /venv
ENTRYPOINT [ "slowloris" ]
CMD ["-h"]
CMD ["-h"]

0 comments on commit 4c89a6a

Please sign in to comment.