Skip to content

Latest commit

 

History

History

node-16

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

node-16

node-16

Download via npm

npm init dockerfile@latest node-16

Dockerfile

FROM node:16-alpine

# Create a new directory for the project
RUN mkdir -p /opt/app

# Change current working directory
WORKDIR /opt/app

# Copy package files
COPY package*.json ./

# Set our env to be in CI
ENV CI true

ENV NODE_ENV production

RUN npm ci

# Copy our project files
COPY . .

# Change directory's owner
RUN chown -R node /opt/app

# Specify running user
USER node

# Port of the application
EXPOSE 8080

CMD [ "node", "main.js" ]