-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (18 loc) · 780 Bytes
/
Copy pathDockerfile
File metadata and controls
24 lines (18 loc) · 780 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM node:16
# Base image for the Dockerfile is the official Node.js version 16 image
# Maintainer of the Docker image
LABEL Maintainer="Emmanuel ADEBAYO <emmanueltolu.adebayo@gmail.com>"
# Purpose of the Docker image
LABEL For="Uncommon API."
# Sets the working directory for the app inside the container
WORKDIR /usr/src/app
# Copies the app's package.json and package-lock.json files into the container
COPY package*.json ./
# Installs dependencies listed in package.json
RUN npm install --force
# Copies the entire app directory into the container
COPY . .
# Builds the production version of the app using 'npm run build'
RUN npm run build
# Specifies the command to run when the container starts - in this case, it runs 'npm run start:prod'
CMD ["npm", "run", "start"]