diff options
-rw-r--r-- | Dockerfile | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/Dockerfile b/Dockerfile index d0687475e..9cf9c7b27 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,15 @@ FROM --platform=linux/amd64 python:3.10-slim -# Set pip to have no saved cache -ENV PIP_NO_CACHE_DIR=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=on \ - POETRY_VERSION=1.2.0 \ - POETRY_HOME="/opt/poetry" \ - POETRY_VIRTUALENVS_IN_PROJECT=true \ - POETRY_NO_INTERACTION=1 \ - INSTALL_DIR="/opt/dependencies" \ - APP_DIR="/bot" - -ENV PATH="$POETRY_HOME/bin:/$INSTALL_DIR/.venv/bin:$PATH" +# 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" RUN apt-get update \ && apt-get -y upgrade \ @@ -20,19 +19,12 @@ RUN apt-get update \ RUN curl -sSL https://install.python-poetry.org | python # Install project dependencies -WORKDIR $INSTALL_DIR +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 -WORKDIR $APP_DIR COPY . . -ENTRYPOINT ["python3"] -CMD ["-m", "bot"] +ENTRYPOINT ["poetry"] +CMD ["run", "python", "-m", "bot"] |