mirror of
https://github.com/derogab/ITAvsCOVIDbot
synced 2025-02-11 09:00:37 +01:00
Use SLIM version of Python as docker base image
This commit is contained in:
parent
ffc7c78315
commit
f43e4c38da
28
Dockerfile
28
Dockerfile
@ -1,36 +1,26 @@
|
|||||||
FROM alpine:latest
|
FROM python:3-slim
|
||||||
|
|
||||||
# Set working space
|
# Set working space
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apk update \
|
RUN apt-get update \
|
||||||
# Install packages
|
# Prevent endless waiting
|
||||||
&& apk add \
|
&& DEBIAN_FRONTEND=noninteractive \
|
||||||
tzdata \
|
|
||||||
build-base freetype-dev libpng-dev openblas-dev \
|
|
||||||
python3 py3-pip py3-numpy py3-pandas py3-matplotlib \
|
|
||||||
wkhtmltopdf \
|
|
||||||
# Set UTC as timezone
|
# Set UTC as timezone
|
||||||
&& ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime \
|
&& ln -snf /usr/share/zoneinfo/Europe/Rome /etc/localtime \
|
||||||
|
# Install APT packages
|
||||||
|
&& apt-get install -y --fix-missing wkhtmltopdf \
|
||||||
# Remove tmp files
|
# Remove tmp files
|
||||||
&& rm -rf /tmp/* /var/tmp/* \
|
&& apt-get clean && rm -rf /tmp/* /var/tmp/* \
|
||||||
# Add PiWheels support
|
# Add PiWheels support
|
||||||
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" >> /etc/pip.conf \
|
&& echo "[global]\nextra-index-url=https://www.piwheels.org/simple" >> /etc/pip.conf \
|
||||||
# Upgrade PIP
|
# Upgrade PIP
|
||||||
&& python3 -m pip install --no-cache-dir --upgrade pip
|
&& python3 -m pip install --no-cache-dir --upgrade pip
|
||||||
|
|
||||||
# Copy requirements
|
# Copy and install requirements
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
|
RUN python3 -m pip install -r requirements.txt
|
||||||
# Install requirements
|
|
||||||
RUN apk update \
|
|
||||||
# Install tmp packages
|
|
||||||
&& apk add --virtual build-deps gcc python3-dev musl-dev \
|
|
||||||
# Install PIP packages
|
|
||||||
&& python3 -m pip install --no-cache-dir -r requirements.txt \
|
|
||||||
# Delete tmp packages
|
|
||||||
&& apk del build-deps
|
|
||||||
|
|
||||||
# Copy app
|
# Copy app
|
||||||
COPY . .
|
COPY . .
|
||||||
|
Loading…
x
Reference in New Issue
Block a user