Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -13
Dockerfile
CHANGED
@@ -1,23 +1,20 @@
|
|
1 |
# Use an official Node runtime as a parent image
|
2 |
FROM node:20
|
3 |
|
4 |
-
# Set the working directory
|
5 |
-
WORKDIR /
|
6 |
|
7 |
-
# Copy package.json and package-lock.json (
|
8 |
-
COPY package
|
9 |
|
10 |
-
# Install
|
11 |
-
RUN npm install
|
12 |
|
13 |
-
#
|
14 |
COPY . .
|
15 |
|
16 |
-
#
|
17 |
-
EXPOSE
|
18 |
|
19 |
-
#
|
20 |
-
ENV NODE_ENV=production
|
21 |
-
|
22 |
-
# Run the app when the container launches
|
23 |
CMD ["node", "server.js"]
|
|
|
1 |
# Use an official Node runtime as a parent image
|
2 |
FROM node:20
|
3 |
|
4 |
+
# Set the working directory inside the container to /app.
|
5 |
+
WORKDIR /app
|
6 |
|
7 |
+
# Copy the package.json and package-lock.json (if available) files into the container.
|
8 |
+
COPY package.json package-lock.json* ./
|
9 |
|
10 |
+
# Install the project dependencies.
|
11 |
+
RUN npm install
|
12 |
|
13 |
+
# Copy the rest of the application code into the container.
|
14 |
COPY . .
|
15 |
|
16 |
+
# Expose port 3000 to have it mapped by Docker daemon
|
17 |
+
EXPOSE 3000
|
18 |
|
19 |
+
# Command to run when starting the container
|
|
|
|
|
|
|
20 |
CMD ["node", "server.js"]
|