Use alpine:latest

This commit is contained in:
Gabriele De Rosa 2021-10-31 02:37:45 +01:00
parent 2cdaf9199e
commit c08169e987
1 changed files with 14 additions and 6 deletions

View File

@ -1,4 +1,4 @@
FROM python:3-alpine FROM alpine:latest
# Set working space # Set working space
WORKDIR /usr/src/app WORKDIR /usr/src/app
@ -7,10 +7,10 @@ WORKDIR /usr/src/app
RUN apk update \ RUN apk update \
# 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 # Install packages
&& apk add \ && apk add \
gcc cmake build-base freetype-dev libpng-dev openblas-dev \ build-base freetype-dev libpng-dev openblas-dev \
py3-numpy py3-pandas py3-matplotlib \ python3 py3-numpy py3-pandas py3-matplotlib \
wkhtmltopdf \ wkhtmltopdf \
# Remove tmp files # Remove tmp files
&& rm -rf /tmp/* /var/tmp/* \ && rm -rf /tmp/* /var/tmp/* \
@ -19,9 +19,17 @@ RUN apk update \
# Upgrade PIP # Upgrade PIP
&& python3 -m pip install --no-cache-dir --upgrade pip && python3 -m pip install --no-cache-dir --upgrade pip
# Copy and install requirements # Copy requirements
COPY requirements.txt . COPY requirements.txt .
RUN python3 -m pip install --no-cache-dir -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 . .