diff options
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 39 |
1 files changed, 16 insertions, 23 deletions
@@ -1,38 +1,31 @@ -FROM python:3.8-slim +FROM python:3.9-slim # Set pip to have cleaner logs and no saved cache ENV PIP_NO_CACHE_DIR=false \ - PIPENV_HIDE_EMOJIS=1 \ - PIPENV_IGNORE_VIRTUALENVS=1 \ - PIPENV_NOSPIN=1 + POETRY_VIRTUALENVS_CREATE=false -# Install git to be able to dowload git dependencies in the Pipfile -RUN apt-get -y update \ - && apt-get install -y \ - ffmpeg \ - && rm -rf /var/lib/apt/lists/* +# Install Poetry and add it to the path +RUN pip install --user poetry +ENV PATH="${PATH}:/root/.local/bin" -# Install pipenv -RUN pip install -U pipenv - -# Copy the project files into working directory WORKDIR /bot -# Copy dependency files -COPY Pipfile Pipfile.lock ./ - -# Install project dependencies -RUN pipenv install --deploy --system +# Copy dependencies and lockfile +COPY pyproject.toml poetry.lock /bot/ -# Copy project code -COPY . . +# Install dependencies and lockfile, excluding development +# dependencies, +RUN poetry install --no-dev --no-interaction --no-ansi -# Set Git SHA enviroment variable +# Set SHA build argument ARG git_sha="development" ENV GIT_SHA=$git_sha -ENTRYPOINT ["python"] -CMD ["-m", "bot"] +# Copy the rest of the project code +COPY . . + +# Start the bot +CMD ["python", "-m", "bot"] # Define docker persistent volumes VOLUME /bot/bot/log /bot/data |