-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdockerfile
48 lines (32 loc) · 1.07 KB
/
dockerfile
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
43
44
45
46
47
48
# # Use an official Node runtime as the base image
# FROM node:20
# # Set the working directory in the container to /app
# WORKDIR /app
# # Copy package.json and package-lock.json to the working directory
# COPY package*.json ./
# # Install any needed packages specified in package.json
# RUN npm install
# RUN npm install -g nodemon
# # Bundle app source inside Docker image
# COPY . .
# # Make port 3000 available to the world outside this container
# EXPOSE 5000
# # Run the app when the container launches
# CMD ["npm", "run", "dev"]
## frontend
# Use an official Node runtime as the base image
FROM node:20
# Set the working directory in the container to /app
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install any needed packages specified in package.json
RUN npm install
RUN npm install -g serve
# Bundle app source inside Docker image
COPY . .
RUN npm run build
# Make port 3000 available to the world outside this container
EXPOSE 3000
# Run the app when the container launches
CMD ["serve" , "-s", "build"]