Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove root user from docker, update ports and update Node / libraries #281

Merged
merged 13 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 9 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
FROM node:8-alpine
FROM node:12-alpine
MAINTAINER "Dan Farrelly <daniel.j.farrelly@gmail.com>"

ENV NODE_ENV production

RUN apk add --no-cache curl

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
USER node

ADD package*.json /usr/src/app/
jovanmaric marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR /home/node
jovanmaric marked this conversation as resolved.
Show resolved Hide resolved

COPY --chown=node:node . /home/node

RUN npm install && \
npm prune && \
npm cache clean --force && \
rm -rf /tmp/*

ADD . /usr/src/app/

EXPOSE 80 25
EXPOSE 1080 1025
jovanmaric marked this conversation as resolved.
Show resolved Hide resolved

ENTRYPOINT ["bin/maildev"]
CMD ["--web", "80", "--smtp", "25"]
ENTRYPOINT ["/home/node/bin/maildev"]
CMD ["--web", "1080", "--smtp", "1025"]

HEALTHCHECK --interval=10s --timeout=1s \
CMD curl -k -f -v http://localhost/healthz || exit 1
CMD curl -k -f -v http://localhost:1080/healthz || exit 1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you want to use MailDev with [Docker](https://www.docker.com/), you can use t
For a guide for usage with Docker,
[checkout the docs](https://github.com/djfarrelly/MailDev/blob/master/docs/docker.md).

$ docker run -p 1080:80 -p 1025:25 djfarrelly/maildev
$ docker run -p 1080:1080 -p 1025:1025 djfarrelly/maildev

For convenient use with Grunt, try [grunt-maildev](https://github.com/xavierpriour/grunt-maildev).

Expand Down
4 changes: 2 additions & 2 deletions docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ If you don't have the image on your machine, Docker will pull it. Let's name
it "maildev" and publish the interface on port `1080`:

```
$ docker run -p 1080:80 --name maildev djfarrelly/maildev
$ docker run -p 1080:1080 --name maildev djfarrelly/maildev
```

Now the MailDev UI will be running at port `1080` on your virtual machine
Expand All @@ -39,7 +39,7 @@ The Dockerfile specifically EXPOSES port 80 and 25, therefor you need to tell ma
This example adds the base-pathname parameter.

```
$ docker run -p 1080:80 -p 1025:25 djfarrelly/maildev bin/maildev --base-pathname /maildev -w 80 -s 25
$ docker run -p 1080:1080 -p 1025:1025 djfarrelly/maildev bin/maildev --base-pathname /maildev -w 1080 -s 1025
```


Expand Down