Skip to content

Instantly share code, notes, and snippets.

@daliborgogic
Created September 20, 2017 17:58
Show Gist options
  • Save daliborgogic/672100aa162a6c73455b6700dda94ef4 to your computer and use it in GitHub Desktop.
Save daliborgogic/672100aa162a6c73455b6700dda94ef4 to your computer and use it in GitHub Desktop.
mnml Node.js Docker image
# Do the npm install in the full image
# The sizes are for the unpacked images as reported by Docker – compressed sizes are about 1/3
# ~ 65.8 MB (npm 5.4.2)
FROM mhart/alpine-node:8.5.0
MAINTAINER Dalibor Gogic <[email protected]>
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install --production
# And then copy over node_modules, etc from that stage to the smaller base image
# ~ 45.4 MB
FROM mhart/alpine-node:base-8.5.0
WORKDIR /app
COPY --from=0 /app .
COPY . .
EXPOSE 3000
CMD ["node", "server"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment