blob: f5cd75b7df368dfd32d60295e47cebd7566c562c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
FROM python:3.9-slim
# Set pip to have cleaner logs and no saved cache
ENV PIP_NO_CACHE_DIR=false \
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 \
gcc \
build-essential \
&& 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"
WORKDIR /bot
# Copy dependencies and lockfile
COPY pyproject.toml poetry.lock /bot/
# Install dependencies and lockfile, excluding development
# dependencies,
RUN poetry install --no-dev --no-interaction --no-ansi
# Set SHA build argument
ARG git_sha="development"
ENV GIT_SHA=$git_sha
# 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
|