DEV Community

Discussion on: Multi-stage Docker and Elixir releases

Collapse
 
quatermain profile image
Oliver Kriška

Nice article. I would like to suggest to show people also possibility to use even more stages. Nice example is using another Docker stage for building assets in case of Phoenix framework. It's easy and just a few lines of code. For example:

...
FROM node:10.16-alpine AS assets

WORKDIR /app
# Compile assets

COPY --from=builder /app/deps /app/deps

COPY assets/ /app/assets/
RUN cd /app/assets && npm install && npm run deploy

FROM builder AS release

COPY --from=assets /app/priv/static /app/priv/static
...