Skip to content

Instantly share code, notes, and snippets.

@jaalorsa517
Created December 9, 2021 00:09
Show Gist options
  • Save jaalorsa517/2555055f6f1334c45d904c8ec633b29f to your computer and use it in GitHub Desktop.
Save jaalorsa517/2555055f6f1334c45d904c8ec633b29f to your computer and use it in GitHub Desktop.
Docker development nodejs
node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
README.md
.gitignore
version: "3"
services:
maback:
container_name: node_maback
build:
context: .
dockerfile: ./Dockerfile
image: maback
container_name: maback
restart: always
command: npm run local
volumes:
- .:/web_app
- node_modules:/web_app/node_modules
ports:
- "3002:3002"
volumes:
node_modules:
FROM node:14
RUN mkdir -p web_app/node_modules && chown -R node:node /web_app
WORKDIR ./web_app
COPY --chown=node:node . .
USER node
RUN npm install
EXPOSE 3002
ENTRYPOINT ["npm","run","local"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment