Commit 99896bbf authored by Lucas Fernandes de Oliveira's avatar Lucas Fernandes de Oliveira
Browse files

Merge branch 'issue/53' into 'master'

Issue #53: Add Dockerfile and .dockerignore

See merge request !48
parents dcaecb33 c6f21eeb
Pipeline #13885 passed with stage
in 53 seconds
# Avoid the use of floating tags like: latest, boron, argon and carbon
LABEL autor="C3SL - Centro de Computação Científica e Software Livre"
# Node was not designed to run as PID 1 (process in docker run with PID 1).
# Its recommended to use the flag --init or use tine to start node process
# in docker
# Add Tini
ENV TINI_VERSION="v0.16.1" WORKSPACE="/home/node/app/"
ADD${TINI_VERSION}/tini /tini
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json $WORKSPACE
chmod +x /tini &&\
chown -R node:node $WORKSPACE
USER node
RUN npm install
# Bundle app source
# COPY copy files as root so chown must be used
USER root
COPY . .
RUN find . -user root | xargs chown node:node
USER node
VOLUME ["/home/node/app/config"]
HEALTHCHECK CMD curl -f http://localhost:3000/v1/metrics || exit 1
# Instead of using npm start to start the container, directly put the command
# that npm start executes.
# First off this reduces the number of processes running inside of your container
# Secondly it causes exit signals such as SIGTERM and SIGINT to be received by
# the Node.js process instead of npm swallowing them.
ENTRYPOINT ["/tini", "--"]
CMD ["node", "index" ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment