diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..93f1361 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +npm-debug.log diff --git a/CHANGELOG.md b/CHANGELOG.md index e95afcc..c747f5f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). +## [0.0.7] - 2017-11-13 +### Added +- Config dependency + ## [0.0.6] - 2017-11-13 ### Added - Config dependency diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a7611ea --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM node:8 + +# Create app directory +WORKDIR /usr/src/app + +# Install app dependencies +COPY package.json . +# For npm@5 or later, copy package-lock.json as well +# COPY package.json package-lock.json ./ + +RUN npm install +# If you are building your code for production +# RUN npm install --only=production + +# Bundle app source +COPY . . + +EXPOSE 3000 + +CMD [ "make", "start" ] + diff --git a/README.md b/README.md index cbd280e..c0bb16a 100644 --- a/README.md +++ b/README.md @@ -21,12 +21,28 @@ Run tests to verify the installation. `$ make test` or `$ make test-coverage` -### Run the project +### Run the project (without [Docker](https://www.docker.com/)) The project is available on [http://127.0.0.1:](http://127.0.0.1:). `$ make start` +### Run the project (with [Docker](https://www.docker.com/)) + +#### Build the image + +`$ docker build -t alexvndre/express-js-starter-pack .` + +You can check that your image is listed by Docker with `$ docker images`. + +#### Run the image + +`$ docker run -p 49160:3000 -d alexvndre/express-js-starter-pack` + +Check if the image is running with `$ docker ps`. You can read the app output with `$ docker logs `. +If you need to run an app command, `$ docker exec -it /bin/bash`. +To kill it: `$ docker kill `. + ### TODO * Command sample ([commander](https://github.com/tj/commander.js))