-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |