diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-05 21:48:24 +0530 |
---|---|---|
committer | Navan Chauhan <navanchauhan@gmail.com> | 2021-06-05 21:48:24 +0530 |
commit | 584eb30f98e862f77e8802c9d9dedb7352cf9a16 (patch) | |
tree | bf60e7974d3ff4032fbf3dd2c7ca13b5f503f23a /Dockerfile | |
parent | dd5fe1f4049db0ef8ccddc4b9d42de1d75b6d7bd (diff) |
trying alpine
Diffstat (limited to 'Dockerfile')
-rw-r--r-- | Dockerfile | 33 |
1 files changed, 26 insertions, 7 deletions
@@ -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 |