diff options
author | 2022-09-13 01:25:10 +0400 | |
---|---|---|
committer | 2022-09-13 01:25:10 +0400 | |
commit | 7adc7587f09d79fddddfcc0b8c6bb75e018963f4 (patch) | |
tree | 78a858d75cc220a538b8a2459ce847d8f42e463d /Dockerfile | |
parent | Merge pull request #2234 from python-discord/infraction-durations (diff) | |
parent | Don't use fake in-project venvs for poetry (diff) |
Merge pull request #2268 from python-discord/pin-poetry-to-1.1.X
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/Dockerfile b/Dockerfile index 5bb400658..9cf9c7b27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,30 @@ FROM --platform=linux/amd64 python:3.10-slim -# Set pip to have no saved cache -ENV PIP_NO_CACHE_DIR=false \ - POETRY_VIRTUALENVS_CREATE=false +# Define Git SHA build argument for sentry +ARG git_sha="development" + +ENV POETRY_VERSION=1.2.0 \ + POETRY_HOME="/opt/poetry" \ + POETRY_NO_INTERACTION=1 \ + APP_DIR="/bot" \ + GIT_SHA=$git_sha +ENV PATH="$POETRY_HOME/bin:$PATH" -# Install poetry -RUN pip install -U poetry +RUN apt-get update \ + && apt-get -y upgrade \ + && apt-get install --no-install-recommends -y curl \ + && apt-get clean && rm -rf /var/lib/apt/lists/* -# Create the working directory -WORKDIR /bot +RUN curl -sSL https://install.python-poetry.org | python # Install project dependencies +WORKDIR $APP_DIR COPY pyproject.toml poetry.lock ./ RUN poetry install --no-dev -# Define Git SHA build argument -ARG git_sha="development" - -# Set Git SHA environment variable for Sentry -ENV GIT_SHA=$git_sha - # Copy the source code in last to optimize rebuilding the image COPY . . -ENTRYPOINT ["python3"] -CMD ["-m", "bot"] +ENTRYPOINT ["poetry"] +CMD ["run", "python", "-m", "bot"] |