sachnun commited on
Commit
182f6a2
·
1 Parent(s): 4c338ca

Fix git identity config by using runtime startup script

Browse files

Git config at build time doesn't persist to runtime container.
Move git config to start.sh which runs at container startup.

Files changed (2) hide show
  1. Dockerfile +7 -6
  2. start.sh +12 -0
Dockerfile CHANGED
@@ -2,13 +2,11 @@ FROM node:20-slim
2
 
3
  WORKDIR /app
4
 
5
- # Force cache invalidation - Update: 2025-10-18 17:17
6
  # Install dependencies: aria2 for downloads, git + git-lfs for HF uploads, CA certificates for SSL
7
  RUN apt-get update && \
8
  apt-get install -y aria2 git git-lfs ca-certificates && \
9
  git lfs install && \
10
- git config --global user.email "bot@hugstream.upload" && \
11
- git config --global user.name "Hugstream Upload Bot" && \
12
  apt-get clean && \
13
  rm -rf /var/lib/apt/lists/*
14
 
@@ -18,14 +16,17 @@ COPY package*.json ./
18
  # Install dependencies
19
  RUN npm install
20
 
21
- # Copy source code
22
  COPY . .
23
 
 
 
 
24
  # Build TypeScript
25
  RUN npm run build
26
 
27
  # Expose port 7860 (Hugging Face Spaces default)
28
  EXPOSE 7860
29
 
30
- # Start the application
31
- CMD ["node", "dist/index.js"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Force cache invalidation - Update: 2025-10-18 17:22
6
  # Install dependencies: aria2 for downloads, git + git-lfs for HF uploads, CA certificates for SSL
7
  RUN apt-get update && \
8
  apt-get install -y aria2 git git-lfs ca-certificates && \
9
  git lfs install && \
 
 
10
  apt-get clean && \
11
  rm -rf /var/lib/apt/lists/*
12
 
 
16
  # Install dependencies
17
  RUN npm install
18
 
19
+ # Copy source code and startup script
20
  COPY . .
21
 
22
+ # Make startup script executable
23
+ RUN chmod +x start.sh
24
+
25
  # Build TypeScript
26
  RUN npm run build
27
 
28
  # Expose port 7860 (Hugging Face Spaces default)
29
  EXPOSE 7860
30
 
31
+ # Start using startup script (configures git at runtime)
32
+ CMD ["./start.sh"]
start.sh ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # Configure git identity for runtime
4
+ git config --global user.email "bot@hugstream.upload"
5
+ git config --global user.name "Hugstream Upload Bot"
6
+
7
+ echo "Git identity configured:"
8
+ git config --global user.email
9
+ git config --global user.name
10
+
11
+ # Start the application
12
+ node dist/index.js