Skip to content

Instantly share code, notes, and snippets.

@ericorruption
Created February 14, 2019 16:52
Show Gist options
  • Save ericorruption/955d560a3f98bb7d604c834228122632 to your computer and use it in GitHub Desktop.
Save ericorruption/955d560a3f98bb7d604c834228122632 to your computer and use it in GitHub Desktop.
Simplest possible node.js dev environment?
# https://medium.com/@francoisromain/getting-started-with-docker-for-local-node-js-development-192ceca18781
version: "3"
services:
app:
image: node:8
volumes:
- ./:/home/node/app
working_dir: "/home/node/app"
user: "node" # don't use the root user for security reasons
ports:
- "3000:3000"
command: bash # Doesn't work for now. Need to figure out a command that leaves the process running
# environment:
# - NODE_ENV=production
## Then log into the machine with:
# docker-compose up -d
# docker-compose exec app {npm install, bash ...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment