Commit 63f7741a authored by VANDAELE Julien's avatar VANDAELE Julien
Browse files

Dockerize the NodeJS application

followed this Node.js guide: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/
and tried to apply those best practices: https://github.com/nodejs/docker-node/blob/master/docs/BestPractices.md
parent 3ef30db0
node_modules
# base image
FROM node:argon
# name of the maintainer of this image
MAINTAINER julien.vandaele@inria.fr
# Add our user and group first to make sure their IDs get assigned consistently
RUN groupadd -r app && useradd -r -g app app
# Create app directory
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
# Install app dependencies
COPY package.json /usr/src/app/
RUN npm install
# Bundle app source
COPY . /usr/src/app
# Tell the docker engine that there will be something listening on the tcp port 8080
EXPOSE 8080
# set the default container command
CMD ["node", "."]
docker build -t lightmap .
docker run \
-e "NODE_ENV=production" \
-u "app" \
-p 8080:8080 \
-w "/usr/src/app" \
--name "lightmap-app" \
-d \
lightmap
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