diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..6b386486 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +node_modules +npm-debug.log +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.vscode diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..40cd02d4 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +FROM node:10-alpine + +# Create app directory +WORKDIR /usr/src/app + +# Install app dependencies +COPY package*.json ./ +RUN yarn install + +# Bundle app source +COPY . . + +EXPOSE 2018 +CMD [ "yarn", "start" ] diff --git a/README.md b/README.md index 7a4da67f..6b0eb0a4 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ · Case studies · + Docker + · Support @@ -137,6 +139,12 @@ The tool (codecrumbs) allows us to learn, document and explain a codebase much f The ultimate goal is to have many case studies hosting at [https://codecrumbs.io](https://codecrumbs.io/). **The library of projects "explained with codecrumbs", the place for collaborative learning**. More features around that coming soon, stay tuned. +## Docker +To start dockerise application run +`docker build -t codecrumbs .` +and once docker image will be build successfully +`docker run -p 2018:2018 -d codecrumbs` + ## Support Any support is very much appreciated! 👍 😘 ❤️ If you like this project, please, **put a :star: and tweet about it**. Thanks! diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..a6781cdb --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +version: '3' + +services: + codecrumbs: + build: . + volumes: + - .:/usr/src/app + - /usr/src/app/node_modules + ports: + - 2018:2018 + - 9229:9229 + - 8888:8888 + command: yarn start