Created
August 25, 2021 18:44
-
-
Save georgerussellpruitt/588f7f683c084d35ce9b0fa59a32062d to your computer and use it in GitHub Desktop.
example nodejs docker setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
node: | |
restart: always | |
build: . | |
ports: | |
- 3000:3000 | |
volumes: | |
- ./:/code | |
mongo: | |
image: mongo | |
ports: | |
- 27017:27017 | |
volumes: | |
- mongodb:/data/db | |
volumes: | |
mongodb: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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