levantermd commited on
Commit
b34944a
·
verified ·
1 Parent(s): d5771ca

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +27 -0
Dockerfile ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use Node.js LTS (Buster) as the base image
2
+ FROM node:lts-buster
3
+
4
+
5
+ # Set the working directory in the container
6
+ WORKDIR /app/pair
7
+
8
+ # Copy package.json and package-lock.json (or yarn.lock if using yarn)
9
+ COPY package*.json ./
10
+
11
+ # Install dependencies (try npm first, fall back to yarn)
12
+ RUN npm install || yarn install
13
+
14
+ # Copy the rest of your app files to the container
15
+ COPY . .
16
+
17
+ # Change ownership of the application files to the 'node' user
18
+ RUN chown -R node:node /app/pair
19
+
20
+ # Switch to the 'node' user for security reasons
21
+ USER node
22
+
23
+ # Expose the port (assuming the app runs on port 8000)
24
+ EXPOSE 7860
25
+
26
+ # Start the app using `npm start`
27
+ CMD ["npm", "start"]