srinetwork commited on
Commit
c267e06
·
verified ·
1 Parent(s): a39f69d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -14
Dockerfile CHANGED
@@ -1,33 +1,29 @@
1
- # SRI API - Hugging Face Spaces Optimized Dockerfile
2
- # Based on Node.js 18 slim image
3
- FROM node:18-slim
4
 
5
- # Set working directory
6
  WORKDIR /app
7
 
8
- # Install Git (required for cloning private repo)
9
- RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
10
 
11
  # Accept GitHub token as build argument
12
  ARG GITHUB_TOKEN
13
- ENV GITHUB_TOKEN=${GITHUB_TOKEN}
14
 
15
- # Clone the private repository
16
- # Using token in URL format for private repo access
17
- RUN git clone https://${GITHUB_TOKEN}@github.com/Walukapah/SRIAPI26.git .
 
18
 
19
  # Install dependencies
20
  RUN npm install
21
 
22
- # Create public directory if not exists
23
  RUN mkdir -p public
24
 
25
- # Expose port 7860 (Hugging Face Spaces default)
26
  EXPOSE 7860
27
 
28
- # Set environment variables for Hugging Face
29
  ENV PORT=7860
30
  ENV NODE_ENV=production
 
31
 
32
- # Start the application
33
  CMD ["node", "server.js"]
 
1
+ # SRI API - Hugging Face Spaces Dockerfile (Fixed)
2
+ FROM node:20-slim
 
3
 
 
4
  WORKDIR /app
5
 
6
+ # Install Git
7
+ RUN apt-get update && apt-get install -y git ca-certificates && rm -rf /var/lib/apt/lists/*
8
 
9
  # Accept GitHub token as build argument
10
  ARG GITHUB_TOKEN
 
11
 
12
+ # Clone private repo (token not stored in final image)
13
+ RUN git clone https://${GITHUB_TOKEN}@github.com/Walukapah/SRIAPI26.git /tmp/repo && \
14
+ cp -r /tmp/repo/* . && \
15
+ rm -rf /tmp/repo .git
16
 
17
  # Install dependencies
18
  RUN npm install
19
 
20
+ # Create public directory
21
  RUN mkdir -p public
22
 
 
23
  EXPOSE 7860
24
 
 
25
  ENV PORT=7860
26
  ENV NODE_ENV=production
27
+ ENV GITHUB_TOKEN=""
28
 
 
29
  CMD ["node", "server.js"]