aboutsummaryrefslogtreecommitdiff
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile33
1 files changed, 26 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile
index 7c527f5..6d7248d 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM python:3.8-slim AS builder
+FROM python:3.8-alpine AS builder
LABEL maintainer = "Navan Chauhan <navanchauhan@gmail.com>" \
org.label-schema.name="SaaS-in-a-Flask" \
@@ -9,12 +9,31 @@ EXPOSE 5000
WORKDIR /saas-in-a-flask
COPY simple-requirements.txt api.py ./
-RUN apt-get update \
- && apt-get install -y --no-install-recommends gcc libssl-dev libffi-dev python3-dev build-essential \
- && rm -rf /var/lib/apt/lists/* \
- && pip install --upgrade pip \
- && pip install -r simple-requirements.txt \
- && apt-get purge -y --auto-remove gcc libssl-dev libffi-dev python3-dev build-essential
+RUN apk add --no-cache --virtual .build-deps \
+ build-base \
+ cairo \
+ cairo-dev \
+ cargo \
+ gcc \
+ libffi-dev \
+ openssl-dev \
+ py-cffi \
+ python3-dev \
+ rust \
+ && pip install -r requirements.txt \
+ && find /usr/local \
+ \( -type d -a -name test -o -name tests \) \
+ -o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
+ -exec rm -rf '{}' + \
+ && runDeps="$( \
+ scanelf --needed --nobanner --recursive /usr/local \
+ | awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
+ | sort -u \
+ | xargs -r apk info --installed \
+ | sort -u \
+ )" \
+ && apk add --virtual .rundeps $runDeps \
+ && apk del .build-deps
COPY ./app ./app