Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kantharia/3739dcafe827fa2979e22bea1f276bf7 to your computer and use it in GitHub Desktop.
Save kantharia/3739dcafe827fa2979e22bea1f276bf7 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