deepak191z commited on
Commit
2e4fe56
·
verified ·
1 Parent(s): 35a87e3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -17
Dockerfile CHANGED
@@ -1,30 +1,29 @@
1
- # Use Node.js 18 base image
2
  FROM node:20
3
 
4
- # Create a non-root user
5
- RUN groupadd -r appuser && useradd -r -g appuser appuser
 
 
 
 
 
 
6
 
7
  # Set working directory
8
  WORKDIR /usr/src/app
9
 
10
- # Copy package files and install dependencies
11
- COPY package*.json ./
12
  RUN npm install
13
- RUN npm install chrome-lens-ocr node-fetch sharp
14
- # If building for production, use:
15
- # RUN npm ci --only=production
16
 
17
- # Copy application source code
18
- COPY . .
19
 
20
- # Change ownership of the app directory to the non-root user
 
21
  RUN chown -R appuser:appuser /usr/src/app
22
-
23
- # Switch to the non-root user
24
  USER appuser
25
 
26
- # Expose the desired port (optional, based on your server.js configuration)
27
- EXPOSE 7860
28
 
29
- # Set the default command to start the server
30
- CMD ["node", "server.js"]
 
 
1
  FROM node:20
2
 
3
+ # Install git
4
+ RUN apt-get update && apt-get install -y git
5
+
6
+ # Set build argument for GitHub token
7
+ ARG GITHUB_TOKEN
8
+
9
+ # Clone the private repo using the token
10
+ RUN git clone https://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@github.com/viratxd/prompt-glow-lab-00.git /usr/src/app
11
 
12
  # Set working directory
13
  WORKDIR /usr/src/app
14
 
15
+ # Install dependencies
16
+
17
  RUN npm install
 
 
 
18
 
 
 
19
 
20
+ # Create and switch to non-root user
21
+ RUN groupadd -r appuser && useradd -r -g appuser appuser
22
  RUN chown -R appuser:appuser /usr/src/app
 
 
23
  USER appuser
24
 
25
+ # Expose the development port
26
+ EXPOSE 3000
27
 
28
+ # Start development server
29
+ CMD ["npm", "run", "dev"]