saucam commited on
Commit
d55729e
·
verified ·
1 Parent(s): 90d79d0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -7
Dockerfile CHANGED
@@ -1,9 +1,10 @@
1
  # Dockerfile for Palisade Security Leaderboard on HuggingFace Spaces
2
 
3
- FROM python:3.12-bookworm
4
 
5
- RUN apt update && apt install -y git make && rm -rf /var/lib/apt/lists/*
6
 
 
7
  RUN useradd -m -u 1000 user
8
 
9
  ENV PATH="/home/user/.local/bin:$PATH"
@@ -15,13 +16,21 @@ RUN chown -R user:user /palisade-leaderboard
15
 
16
  USER user
17
 
18
- WORKDIR /palisade-leaderboard
19
 
20
- # Install dependencies
21
- RUN pip install --no-cache-dir -r requirements.txt
 
22
 
23
- ENV GRADIO_SERVER_NAME="0.0.0.0"
 
 
 
 
 
 
24
 
25
  EXPOSE 7860
26
 
27
- CMD ["make", "run-leaderboard"]
 
 
1
  # Dockerfile for Palisade Security Leaderboard on HuggingFace Spaces
2
 
3
+ FROM node:20-bookworm-slim
4
 
5
+ RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
6
 
7
+ # Create non-root user
8
  RUN useradd -m -u 1000 user
9
 
10
  ENV PATH="/home/user/.local/bin:$PATH"
 
16
 
17
  USER user
18
 
19
+ WORKDIR /palisade-leaderboard/frontend
20
 
21
+ # Install dependencies and build
22
+ RUN npm ci
23
+ RUN npm run build
24
 
25
+ # Copy static files to standalone directory (required for standalone mode)
26
+ RUN cp -r public .next/standalone/ && cp -r .next/static .next/standalone/.next/
27
+
28
+ ENV NODE_ENV=production
29
+ ENV NEXT_TELEMETRY_DISABLED=1
30
+ ENV PORT=7860
31
+ ENV HOSTNAME="0.0.0.0"
32
 
33
  EXPOSE 7860
34
 
35
+ # Use standalone server for better performance
36
+ CMD ["node", ".next/standalone/server.js"]