Skip to content

Instantly share code, notes, and snippets.

@georgerussellpruitt
Created August 25, 2021 18:44
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 georgerussellpruitt/588f7f683c084d35ce9b0fa59a32062d to your computer and use it in GitHub Desktop.
Save georgerussellpruitt/588f7f683c084d35ce9b0fa59a32062d to your computer and use it in GitHub Desktop.
example nodejs docker setup
version: '3'
services:
node:
restart: always
build: .
ports:
- 3000:3000
volumes:
- ./:/code
mongo:
image: mongo
ports:
- 27017:27017
volumes:
- mongodb:/data/db
volumes:
mongodb:
FROM node:16-alpine
WORKDIR /app
COPY ["package.json", "package-lock.json*", "./"]
RUN npm install
COPY . .
CMD ["npm", "start"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment