Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +23 -0
Dockerfile
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Node runtime as a parent image
|
2 |
+
FROM node:20
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /usr/src/app
|
6 |
+
|
7 |
+
# Copy package.json and package-lock.json (or npm-shrinkwrap.json) files
|
8 |
+
COPY package*.json ./
|
9 |
+
|
10 |
+
# Install any needed packages specified in package.json
|
11 |
+
RUN npm install
|
12 |
+
|
13 |
+
# Bundle the app's source code inside the Docker image
|
14 |
+
COPY . .
|
15 |
+
|
16 |
+
# Make port 3000 available to the world outside this container
|
17 |
+
EXPOSE 3000
|
18 |
+
|
19 |
+
# Define environment variable
|
20 |
+
ENV NODE_ENV=production
|
21 |
+
|
22 |
+
# Run the app when the container launches
|
23 |
+
CMD ["node", "server.js"]
|