Skip to content

Commit

Permalink
Merge pull request #280 from AndreyNikiforov/feature/docker-alpine
Browse files Browse the repository at this point in the history
use alpine python image for docker
  • Loading branch information
AndreyNikiforov authored Jan 15, 2021
2 parents bdc2158 + f7e0d33 commit 8cfe0ce
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ COPY requirements.txt .
RUN pip3 install -r requirements-pip.txt
RUN pip3 install -r requirements.txt

FROM base as test

FROM base as common
RUN apt-get update && apt-get install -y dos2unix
RUN mkdir Photos
COPY requirements*.txt ./
Expand All @@ -20,13 +19,20 @@ RUN scripts/install_deps
COPY . .
RUN dos2unix scripts/*
ENV TZ="America/Los_Angeles"

FROM common as test

RUN scripts/test
RUN scripts/lint

FROM base as runtime
FROM common as build

COPY . .
RUN python setup.py install
RUN scripts/build

FROM python:3.9-alpine as runtime

COPY --from=build /app/dist/* /tmp
RUN pip3 install /tmp/*.whl

# copy from test to ensure test stage runs before runtime stage in buildx
COPY --from=test /app/.coverage .

0 comments on commit 8cfe0ce

Please sign in to comment.