Repository: jdleesmiller/docker-chat-demo Branch: master Commit: fdb3c5708ea8 Files: 7 Total size: 5.4 KB Directory structure: gitextract_ktr6e2lm/ ├── .dockerignore ├── Dockerfile ├── README.md ├── docker-compose.yml ├── index.html ├── index.js └── package.json ================================================ FILE CONTENTS ================================================ ================================================ FILE: .dockerignore ================================================ .dockerignore .git docker-compose*.yml Dockerfile node_modules ================================================ FILE: Dockerfile ================================================ FROM node:10.16.3 AS development RUN mkdir /srv/chat && chown node:node /srv/chat USER node WORKDIR /srv/chat COPY --chown=node:node package.json package-lock.json ./ RUN npm install --quiet FROM node:10.16.3-slim AS production USER node WORKDIR /srv/chat COPY --from=development --chown=root:root /srv/chat/node_modules ./node_modules COPY . . CMD ["node", "index.js"] ================================================ FILE: README.md ================================================ # Docker Chat Demo Companion repo for this article on my blog: - [Lessons from Building a Node App in Docker](https://jdlm.info/articles/2019/09/06/lessons-building-node-app-docker.html) (2019 update). - [Lessons from Building a Node App in Docker](http://jdlm.info/articles/2016/03/06/lessons-building-node-app-docker.html) (2016 original). Contains step-by-step examples used in the article to get the [socket.io chat example](http://socket.io/get-started/chat) running in Docker. ## 2019 Update Each step has a tag: - [2019-01-bootstrapping](https://github.com/jdleesmiller/docker-chat-demo/tree/2019-01-bootstrapping) - [2019-02-bootstrapped](https://github.com/jdleesmiller/docker-chat-demo/tree/2019-02-bootstrapped) - [2019-03-dependencies](https://github.com/jdleesmiller/docker-chat-demo/tree/2019-03-dependencies) - [2019-04-the-app](https://github.com/jdleesmiller/docker-chat-demo/tree/2019-04-the-app) - [2019-05-dev-prod](https://github.com/jdleesmiller/docker-chat-demo/tree/2019-05-dev-prod) ## 2016 Original Here's the [original code from 2016](https://github.com/jdleesmiller/docker-chat-demo/tree/2016). Each step has a tag: - [01-bootstrapping](https://github.com/jdleesmiller/docker-chat-demo/tree/01-bootstrapping) - [02-bootstrapped](https://github.com/jdleesmiller/docker-chat-demo/tree/02-bootstrapped) - [03-dependencies](https://github.com/jdleesmiller/docker-chat-demo/tree/03-dependencies) - [04-the-app](https://github.com/jdleesmiller/docker-chat-demo/tree/04-the-app) - [05-dev-prod](https://github.com/jdleesmiller/docker-chat-demo/tree/05-dev-prod) ## License The ISC license: Copyright (c) 2016–2019, John Lees-Miller Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ================================================ FILE: docker-compose.yml ================================================ version: '3.7' services: chat: build: context: . target: development command: npx nodemon index.js ports: - '3000:3000' volumes: - .:/srv/chat - chat_node_modules:/srv/chat/node_modules volumes: chat_node_modules: ================================================ FILE: index.html ================================================