Skip to content

Instantly share code, notes, and snippets.

@YannMjl
Last active May 7, 2021 01:01
Show Gist options
  • Save YannMjl/1d50284fc9c97e5e143b5d3d6d13fd04 to your computer and use it in GitHub Desktop.
Save YannMjl/1d50284fc9c97e5e143b5d3d6d13fd04 to your computer and use it in GitHub Desktop.
FROM node
# update dependencies and install curl
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create app directory
WORKDIR /app
# 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 ./
# update each dependency in package.json to the latest version
RUN npm install -g npm-check-updates
RUN ncu -u
RUN npm install
RUN npm install express
# If you are building your code for production
# RUN npm ci --only=production
# Bundle app source
COPY . /app
EXPOSE 30100
CMD [ "node", "server.js" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment