Skip to content

Instantly share code, notes, and snippets.

@danfromisrael
Last active August 9, 2017 14:59
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save danfromisrael/13061cb22e8b763719a1077ed857e31f to your computer and use it in GitHub Desktop.
Save danfromisrael/13061cb22e8b763719a1077ed857e31f to your computer and use it in GitHub Desktop.
Docker container only for development (node.js)

When running develop.sh it will build a node development container in interactive mode (bash) your code folder is shared as a volume into the container workdir meaning you can edit the files in your favorite IDE/Code editor without the need to restart it.

#dont copy my computer node_modules into the container
node_modules
docker-compose run web bash
version: '3'
services:
web:
build: .
ports:
- "8080:8080"
volumes:
- .:/usr/src/app
- node_modules:/usr/src/app/node_modules
volumes:
node_modules: {}
FROM node:boron
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
EXPOSE 8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment