Add PiWheels support

This commit is contained in:
Gabriele De Rosa 2021-10-17 15:28:01 +02:00
parent 64c1885fcf
commit a9fbe72fa4
1 changed files with 18 additions and 5 deletions

View File

@ -3,11 +3,24 @@ FROM python:3
# Set working space
WORKDIR /usr/src/app
# Install requirements
RUN ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime && \
apt-get update && apt-get install -y wkhtmltopdf
# Install dependencies
RUN apt-get update \
# Prevent endless waiting
&& DEBIAN_FRONTEND=noninteractive \
# Set UTC as timezone
&& ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime \
# Install APT packages
&& apt-get install -y --fix-missing wkhtmltopdf \
# Remove tmp files
&& apt-get clean && rm -rf /tmp/* /var/tmp/* \
# 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
# Copy and install requirements
COPY requirements.txt .
RUN pip install -r requirements.txt
RUN python3 -m pip install -r requirements.txt
# Copy app
COPY . .
@ -16,4 +29,4 @@ COPY . .
RUN mkdir out
# Start the bot
CMD python -u bot.py
CMD python3 -u bot.py