Skip to content

Commit

Permalink
fix: misc stuff on the dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
chkpwd committed Oct 26, 2024
1 parent 0dcc0ec commit d3b5177
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
FROM python:3.12-slim-bookworm AS base

ENV PYTHONUNBUFFERED=1 \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random
PYTHONFAULTHANDLER=1

WORKDIR /src

FROM base AS builder

ENV PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
POETRY_VERSION=1.8
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_NO_INTERACTION=1 \
POETRY_VERSION=1.8

RUN pip install "poetry==$POETRY_VERSION"

COPY poetry.lock pyproject.toml ./

RUN poetry config virtualenvs.in-project true && \
poetry install --only=main --no-root
poetry install --only=main

FROM base AS final

RUN adduser -u 1000 python

USER python

ENV ADDRESS=0.0.0.0 \
PORT=7979 \
DEBUG=false
ENV DEBUG=false

COPY --from=builder /src/.venv ./.venv
COPY constants/ ./constants/
COPY app/ ./app/
COPY main.py .

EXPOSE 7979

ENTRYPOINT ["/src/.venv/bin/python3", "./main.py"]

0 comments on commit d3b5177

Please sign in to comment.