Merge pull request #127 from adamantike/fix/copy-dependencies-from-stage
Reduce Docker image size by only copying pip installed dependencies
This commit is contained in:
commit
9a295bbf91
@ -6,12 +6,13 @@ FROM python:alpine AS base
|
||||
FROM base AS dependencies
|
||||
# install dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
RUN pip install --user -r requirements.txt
|
||||
|
||||
#
|
||||
# ---- Release ----
|
||||
FROM dependencies AS release
|
||||
# copy project source file(s)
|
||||
FROM base AS release
|
||||
# copy installed dependencies and project source file(s)
|
||||
WORKDIR /
|
||||
COPY --from=dependencies /root/.local /root/.local
|
||||
COPY cloudflare-ddns.py .
|
||||
CMD ["python", "-u", "/cloudflare-ddns.py", "--repeat"]
|
||||
Reference in New Issue
Block a user