Skip to content

Commit

Permalink
Merge pull request #1 from PerchunPak/main
Browse files Browse the repository at this point in the history
Fix deploy
  • Loading branch information
salko-ua authored Jan 21, 2024
2 parents 2983293 + b19ae41 commit 2de9e51
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
11 changes: 5 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
FROM python:3.11-slim AS poetry
FROM python:3.12 AS poetry

ENV PATH "/root/.local/bin:${PATH}"
ENV PYTHONUNBUFFERED 1
ENV POETRY_VIRTUALENVS_IN_PROJECT 1

WORKDIR /root
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt-get install curl -y --no-install-recommends && \
curl -sSL https://install.python-poetry.org | python -
COPY poetry.lock pyproject.toml ./
RUN poetry export --no-interaction -o requirements.txt --without-hashes --only main,docker
RUN poetry install --only main,docker


FROM python:3.12-slim AS base
Expand All @@ -21,14 +22,12 @@ WORKDIR /app

RUN groupadd -g 5000 container && useradd -d /app -m -g container -u 5000 container

COPY --from=poetry /root/requirements.txt ./
RUN pip --no-cache-dir install -U pip && \
pip --no-cache-dir install -r requirements.txt
COPY --from=poetry /root/.venv ./.venv
COPY . .

FROM base AS final

RUN chown -R 5000:5000 /app
USER container

CMD ["dumb-init", "python", "main.py]
CMD [".venv/bin/dumb-init", ".venv/bin/python", "main.py"]
18 changes: 16 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2de9e51

Please sign in to comment.