Skip to content

Instantly share code, notes, and snippets.

@paulmwatson
Created January 21, 2021 14:13
Show Gist options
  • Save paulmwatson/674cefb57b47f151598cb117fd839b2b to your computer and use it in GitHub Desktop.
Save paulmwatson/674cefb57b47f151598cb117fd839b2b to your computer and use it in GitHub Desktop.
Docker multi-stage build with large files
#Dockerfile
#model_artifacts image
FROM python:3.7.7-slim-buster AS model_artifacts
WORKDIR /artifacts
ADD https://bucketname.s3-eu-west-1.amazonaws.com/really_big_model_1.h5 .
ADD https://bucketname.s3-eu-west-1.amazonaws.com/really_big_model_2.h5 .
#app image
FROM python:3.7.7-slim-buster AS app
...
RUN mkdir /model_files
COPY --from=model_artifacts /artifacts/* /model_files/
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment