tfrere commited on
Commit
e4c8e21
·
1 Parent(s): 53f8106

fix space env variables

Browse files
Files changed (3) hide show
  1. Dockerfile +4 -4
  2. server/.env.example +3 -4
  3. server/server.py +2 -2
Dockerfile CHANGED
@@ -34,10 +34,10 @@ RUN echo 'from fastapi import FastAPI\nfrom fastapi.staticfiles import StaticFil
34
  # Environment variables
35
  ENV API_HOST=0.0.0.0 \
36
  API_PORT=7860 \
37
- UPDATE_INTERVAL_MINUTES=15 \
38
- HF_TOKEN="" \
39
- REPO_ID="tfrere/leaderboard-explorer" \
40
- FILE_PATH="final_leaderboards.json"
41
 
42
  # Create cache directory and set permissions
43
  RUN mkdir -p /app/cache && chown -R user:user /app/cache
 
34
  # Environment variables
35
  ENV API_HOST=0.0.0.0 \
36
  API_PORT=7860 \
37
+ HF_TOKEN=${HUGGING_FACE_HUB_TOKEN} \
38
+ HF_STORAGE_REPO=${HF_STORAGE_REPO} \
39
+ HF_STORAGE_FILE_PATH=${HF_STORAGE_FILE_PATH} \
40
+ UPDATE_INTERVAL_MINUTES=${UPDATE_INTERVAL_MINUTES:-15}
41
 
42
  # Create cache directory and set permissions
43
  RUN mkdir -p /app/cache && chown -R user:user /app/cache
server/.env.example CHANGED
@@ -4,11 +4,10 @@ HUGGING_FACE_HUB_TOKEN=your_token_here
4
 
5
  # Repository ID for storing leaderboard data (required)
6
  # Format: username/repo-name
7
- HF_STORAGE_REPO=username/leaderboard-data
8
 
9
- # API Configuration (optional)
10
- API_HOST=0.0.0.0
11
- API_PORT=3002
12
 
13
  # Update interval in minutes (optional, default: 30)
14
  UPDATE_INTERVAL_MINUTES=30
 
4
 
5
  # Repository ID for storing leaderboard data (required)
6
  # Format: username/repo-name
7
+ HF_STORAGE_REPO=tfrere/leaderboard-explorer
8
 
9
+ # File path in the repository
10
+ HF_STORAGE_FILE_PATH = "final_leaderboards.json"
 
11
 
12
  # Update interval in minutes (optional, default: 30)
13
  UPDATE_INTERVAL_MINUTES=30
server/server.py CHANGED
@@ -36,8 +36,8 @@ cache = {
36
 
37
  # HF API configuration
38
  HF_TOKEN = os.getenv("HF_TOKEN")
39
- REPO_ID = "tfrere/leaderboard-explorer"
40
- FILE_PATH = "final_leaderboards.json"
41
  CACHE_DURATION_MINUTES = int(os.getenv("UPDATE_INTERVAL_MINUTES", "15")) # Get from env or default to 15
42
 
43
  # Initialize HF API client
 
36
 
37
  # HF API configuration
38
  HF_TOKEN = os.getenv("HF_TOKEN")
39
+ REPO_ID = os.getenv("HF_STORAGE_REPO")
40
+ FILE_PATH = os.getenv("HF_STORAGE_FILE_PATH")
41
  CACHE_DURATION_MINUTES = int(os.getenv("UPDATE_INTERVAL_MINUTES", "15")) # Get from env or default to 15
42
 
43
  # Initialize HF API client