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

Dockerize the NodeJS application

followed this Node.js guide:
and tried to apply those best practices:
parent 3ef30db0
# base image
FROM node:argon
# name of the maintainer of this image
# 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
# 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 \
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