Created
          December 9, 2021 00:09 
        
      - 
      
- 
        Save jaalorsa517/2555055f6f1334c45d904c8ec633b29f to your computer and use it in GitHub Desktop. 
    Docker development nodejs
  
        
  
    
      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
    
  
  
    
  | node_modules | |
| npm-debug.log | |
| Dockerfile | |
| .dockerignore | |
| .git | |
| README.md | |
| .gitignore | 
  
    
      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: | |
| 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: | 
  
    
      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: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