Skip to content

Commit

Permalink
🐳 Improve Dockerfile and update docker image usage (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
bgauduch authored and frinyvonnick committed Jul 5, 2019
1 parent 0dfa1bb commit 55e24c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM node:10.16.0-alpine
ENV NODE_ENV=production

# install dependencies
RUN apk add --no-cache git=2.20.1-r0
ENV NODE_ENV=production

# build gitmoji-changelog from source
WORKDIR /usr/src/gitmoji-changelog
Expand All @@ -11,4 +11,5 @@ RUN yarn --frozen-lockfile && yarn cache clean

# run gitmoji-changelog on container startup
RUN ln -s /usr/src/gitmoji-changelog/node_modules/.bin/gitmoji-changelog /usr/bin
WORKDIR /app
ENTRYPOINT ["gitmoji-changelog"]
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ yarn lint

Launch `gitmoji-changelog` using the [official Docker image](https://hub.docker.com/r/yvonnick/gitmoji-changelog):
```sh
docker container run -it -v $(pwd):/app -w /app --rm yvonnick/gitmoji-changelog:latest
docker container run -it -v $(pwd):/app --rm yvonnick/gitmoji-changelog:latest
```

> `/app` is the directory where gitmoji-changelog expect your project in the container.
You can also build the image locally and use it directly:
```sh
# build the image:
docker image build -t yvonnick/gitmoji-changelog:dev .
# use it:
docker container run -it -v $(pwd):/app -w /app --rm yvonnick/gitmoji-changelog:dev
docker container run -it -v $(pwd):/app --rm yvonnick/gitmoji-changelog:dev
```

## Author
Expand Down

0 comments on commit 55e24c2

Please sign in to comment.