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

Wrap Node.js server with tini in Docker image #367

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
FROM node
MAINTAINER Niko Bellic <[email protected]>

# wrap Node.js process with tini to handle stop signal
ENV TINI_VERSION v0.16.1
RUN wget -O /tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini \
&& chmod +x /tini

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

Expand All @@ -13,4 +18,5 @@ COPY . /usr/src/app

EXPOSE 9100

CMD grunt server
ENTRYPOINT ["/tini", "--"]
CMD ["grunt", "server"]
9 changes: 8 additions & 1 deletion Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
# docker build -t mobz/elasticsearch-head:5-alpine -f Dockerfile-alpine .

FROM node:alpine

# wrap Node.js process with tini to handle stop signal
RUN apk add --no-cache --update tini

WORKDIR /usr/src/app
RUN npm install http-server
COPY . .

EXPOSE 9100
CMD node_modules/http-server/bin/http-server _site -p 9100

ENTRYPOINT ["tini", "--"]
CMD ["node_modules/http-server/bin/http-server", "_site", "-p", "9100"]