-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (30 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
42 lines (30 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Use an official Node.js runtime as a parent image
FROM node:16
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy the package.json and package-lock.json files
# This is done to install dependencies first, before copying the rest of the application files
COPY package*.json ./
# Install the app dependencies
RUN npm install
# Copy the rest of the application files
COPY . .
# Expose the port the app will run on (typically 3000 for Node.js apps)
EXPOSE 3000
# Define the command to run your app
CMD ["npm", "start"]
# Use an official Node.js runtime as a parent image
FROM node:16
# Set the working directory in the container
WORKDIR /usr/src/app
# Copy the package.json and package-lock.json files
# This is done to install dependencies first, before copying the rest of the application files
COPY package*.json ./
# Install the app dependencies
RUN npm install
# Copy the rest of the application files
COPY . .
# Expose the port the app will run on (typically 3000 for Node.js apps)
EXPOSE 3000
# Define the command to run your app
CMD ["npm", "start"]