2021-11-26 01:54:34 +01:00
|
|
|
FROM python:3-slim
|
2021-01-06 17:57:35 +01:00
|
|
|
|
|
|
|
# Set working space
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
2021-10-17 15:28:01 +02:00
|
|
|
# Install dependencies
|
2021-11-26 01:54:34 +01:00
|
|
|
RUN apt-get update \
|
|
|
|
# Prevent endless waiting
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive \
|
2021-10-31 02:48:30 +01:00
|
|
|
# Set UTC as timezone
|
|
|
|
&& ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime \
|
2021-11-26 01:54:34 +01:00
|
|
|
# Install APT packages
|
2021-11-26 02:11:50 +01:00
|
|
|
&& apt-get install -y --fix-missing wkhtmltopdf gfortran \
|
2021-10-17 15:28:01 +02:00
|
|
|
# Remove tmp files
|
2021-11-26 01:54:34 +01:00
|
|
|
&& apt-get clean && rm -rf /tmp/* /var/tmp/* \
|
2021-10-17 15:28:01 +02:00
|
|
|
# Add PiWheels support
|
|
|
|
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" >> /etc/pip.conf \
|
|
|
|
# Upgrade PIP
|
|
|
|
&& python3 -m pip install --no-cache-dir --upgrade pip
|
|
|
|
|
2021-11-26 01:54:34 +01:00
|
|
|
# Copy and install requirements
|
2021-01-06 17:57:35 +01:00
|
|
|
COPY requirements.txt .
|
2021-11-26 01:54:34 +01:00
|
|
|
RUN python3 -m pip install -r requirements.txt
|
2021-01-06 17:57:35 +01:00
|
|
|
|
|
|
|
# Copy app
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Create folder
|
|
|
|
RUN mkdir out
|
|
|
|
|
|
|
|
# Start the bot
|
2021-10-17 15:28:01 +02:00
|
|
|
CMD python3 -u bot.py
|