Skip to content

Commit

Permalink
Merge pull request #9 from Bizordec/develop
Browse files Browse the repository at this point in the history
fix(docker): Fix docker image build error caused by old poetry
  • Loading branch information
Bizordec authored Aug 10, 2023
2 parents cbefb8f + 200c27a commit da235bf
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,29 @@
FROM python:3.8.13-slim as build-stage

RUN apt-get update && apt-get install -y git build-essential
FROM python:3.10.12-bullseye as build-stage

WORKDIR /vk-to-tgm

ENV VIRTUAL_ENV=/vk-to-tgm/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VIRTUALENVS_IN_PROJECT=1

RUN pip install poetry==1.1.13 \
&& python -m venv $VIRTUAL_ENV
RUN pip install poetry==1.5.1

COPY ./pyproject.toml ./poetry.lock* /vk-to-tgm/
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes \
&& pip install --no-cache-dir -r requirements.txt
RUN poetry install --no-root --without=dev --no-interaction --no-ansi


FROM python:3.8.13-slim
FROM python:3.10.12-slim-bullseye

WORKDIR /vk-to-tgm

ENV VIRTUAL_ENV=/vk-to-tgm/.venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PATH="/vk-to-tgm/.venv/bin:$PATH"

COPY --from=build-stage /vk-to-tgm/.venv/ $VIRTUAL_ENV
COPY --from=build-stage /vk-to-tgm/.venv/ /vk-to-tgm/.venv

RUN mkdir logs/

Expand Down

0 comments on commit da235bf

Please sign in to comment.