saucam commited on
Commit
1d48421
·
verified ·
1 Parent(s): e31691c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -4
Dockerfile CHANGED
@@ -5,11 +5,13 @@ FROM node:20-bookworm-slim
5
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
 
7
  # Clone the leaderboard repository from GitHub
8
- ARG GITHUB_TOKEN
9
- RUN if [ -n "$GITHUB_TOKEN" ]; then \
10
- git clone https://${GITHUB_TOKEN}@github.com/getjavelin/palisade-leaderboard.git /palisade-leaderboard; \
 
 
11
  else \
12
- git clone https://github.com/getjavelin/palisade-leaderboard.git /palisade-leaderboard; \
13
  fi
14
 
15
  # Use the existing 'node' user (UID 1000) that comes with the node image
 
5
  RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
 
7
  # Clone the leaderboard repository from GitHub
8
+ # HF Spaces mounts secrets at /run/secrets/<SECRET_NAME> during build
9
+ RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444 \
10
+ if [ -f /run/secrets/GITHUB_TOKEN ]; then \
11
+ GITHUB_TOKEN=$(cat /run/secrets/GITHUB_TOKEN) && \
12
+ git clone https://${GITHUB_TOKEN}@github.com/highflame-ai/palisade-leaderboard.git /palisade-leaderboard; \
13
  else \
14
+ git clone https://github.com/highflame-ai/palisade-leaderboard.git /palisade-leaderboard; \
15
  fi
16
 
17
  # Use the existing 'node' user (UID 1000) that comes with the node image