Skip to content

Instantly share code, notes, and snippets.

@sskoopa
Created October 26, 2016 20:59
Show Gist options
  • Save sskoopa/333b098035e66639f3a947459f095ac9 to your computer and use it in GitHub Desktop.
Save sskoopa/333b098035e66639f3a947459f095ac9 to your computer and use it in GitHub Desktop.
Dockerfile for using google-cloud (or any native module) and sharing app with Mac local
#alpine-node is a super small distro with just the minimum to run
FROM mhart/alpine-node:6
WORKDIR /app
#allow local code to mount into this directory
VOLUME /app
#move all native plugins up to -g installs and link them one level above the app
RUN npm install -g google-cloud && cd / && npm link google-cloud && cd /app
#serve on port 8080
EXPOSE 8080
#call npm start on whatever directory you mounted to /app
CMD npm start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment