Skip to content

Commit

Permalink
Merge pull request #7 from alexvndre/feature/dockerize
Browse files Browse the repository at this point in the history
Feature/dockerize
  • Loading branch information
alexvndre committed Nov 13, 2017
2 parents ecee8f0 + e74caec commit 33af5ff
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
npm-debug.log
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- Add Docker

## [0.0.6] - 2017-11-13
### Added
- Config dependency
Expand Down
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]

18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:<PORT>](http://127.0.0.1:<PORT>).

`$ 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 <CONTAINER_ID>`.
If you need to run an app command, `$ docker exec -it <CONTAINER_ID> /bin/bash`.
To kill it: `$ docker kill <CONTAINER_ID>`.

### TODO

* Command sample ([commander](https://github.com/tj/commander.js))
Expand Down

0 comments on commit 33af5ff

Please sign in to comment.