1- FROM python:3.8-alpine
1+ # -- build dependencies with debian(multiarch) --
2+ FROM python:3.8-slim AS build
2334ARG PIPMIRROR=https://pypi.org/simple
5+ COPY requirements /requirements
6+ RUN pip install --timeout 30 --index $PIPMIRROR --user --no-cache-dir --no-warn-script-location -r /requirements/all.txt
7+
8+ # -- app environment(multiarch) --
9+ FROM python:3.8-alpine
410ARG ALPINEMIRROR=dl-cdn.alpinelinux.org
511ENV sapic_isrun=true
6- COPY requirements /requirements
7- RUN sed -i "s/dl-cdn.alpinelinux.org/${ALPINEMIRROR}/g" /etc/apk/repositories && \
8- apk upgrade --no-cache && \
12+ COPY --from=build /root/.local /root/.local
13+ RUN apk upgrade --no-cache && \
914 apk add --no-cache libgcc libstdc++ gcompat && \
10- pip install --upgrade pip && \
11- pip install --timeout 30 --index $PIPMIRROR --user --no-cache-dir --no-warn-script-location -r /requirements/all.txt && \
12- LOCAL_PKG="/root/.local" && \
13- ln -sf ${LOCAL_PKG}/bin/flask ${LOCAL_PKG}/bin/gunicorn /bin/ && \
15+ pip install --no-cache-dir --user -U pip pillow && \
16+ ln -sf /root/.local/bin/flask /root/.local/bin/gunicorn /bin/ && \
1417 ln -sf $(which python) /python && \
1518 sed -i "s#$(which python)#/python#" /bin/gunicorn
1619WORKDIR /picbed
1720COPY src /picbed
1821EXPOSE 9514
19- ENTRYPOINT ["gunicorn" , "app:app" , "-c" , "sapicd.py" ]
22+ ENTRYPOINT ["gunicorn" , "app:app" , "-c" , "sapicd.py" ]
0 commit comments