Compare commits
6 Commits
30f1023f6c
...
f4caa7a924
Author | SHA1 | Date |
---|---|---|
Gabriele De Rosa | f4caa7a924 | |
Gabriele De Rosa | 6cbbd6d1b3 | |
Gabriele De Rosa | 35de8e84c6 | |
Gabriele De Rosa | b1ba5cf3f2 | |
Gabriele De Rosa | 6352e9df70 | |
Gabriele De Rosa | 487d77e90e |
34
Dockerfile
34
Dockerfile
|
@ -1,26 +1,38 @@
|
||||||
FROM python:3-slim
|
FROM alpine:3.14
|
||||||
|
|
||||||
# Set working space
|
# Set working space
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN apt-get update \
|
RUN apk update --no-cache \
|
||||||
# Prevent endless waiting
|
# Install packages
|
||||||
&& DEBIAN_FRONTEND=noninteractive \
|
&& apk add --no-cache \
|
||||||
|
tzdata \
|
||||||
|
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 gfortran \
|
|
||||||
# Remove tmp files
|
# Remove tmp files
|
||||||
&& apt-get clean && rm -rf /tmp/* /var/tmp/* \
|
&& rm -rf /tmp/* /var/tmp/* \
|
||||||
# Add PiWheels support
|
|
||||||
&& 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 and install requirements
|
# Copy PIP extra index URLs
|
||||||
|
COPY pip.conf .
|
||||||
|
|
||||||
|
# Copy requirements
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN python3 -m pip install -r requirements.txt
|
|
||||||
|
# Install requirements
|
||||||
|
RUN apk update --no-cache \
|
||||||
|
# Install tmp packages
|
||||||
|
&& apk add --no-cache --virtual build-deps gcc python3-dev musl-dev build-base freetype-dev libpng-dev openblas-dev \
|
||||||
|
# Add PIP extra index URLs
|
||||||
|
&& mv pip.conf /etc/pip.conf \
|
||||||
|
# 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…
Reference in New Issue