File size: 931 Bytes
d01a676
 
796c134
d01a676
 
 
796c134
 
 
d01a676
 
 
 
 
 
 
 
 
 
796c134
 
 
d01a676
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM node:20-slim

# Install system dependencies + native addon build tools
RUN apt-get update && apt-get install -y \
    git \
    curl \
    python3 \
    make \
    g++ \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN git clone https://github.com/decolua/9router.git .

RUN npm install

RUN npm run build

# Optional: remove build tools after build to reduce image size
RUN apt-get purge -y --auto-remove python3 make g++

RUN mkdir -p /data /root/.9router

ENV PORT=7860
ENV HOSTNAME=0.0.0.0
ENV NODE_ENV=production
ENV DATA_DIR=/data
ENV INITIAL_PASSWORD=changeme123
ENV JWT_SECRET=please-change-this-jwt-secret-in-hf-spaces-settings
ENV API_KEY_SECRET=please-change-this-api-key-secret
ENV MACHINE_ID_SALT=please-change-this-salt
ENV REQUIRE_API_KEY=false
ENV AUTH_COOKIE_SECURE=true
ENV ENABLE_REQUEST_LOGS=false

EXPOSE 7860

COPY start-hf.sh /app/start-hf.sh
RUN chmod +x /app/start-hf.sh

CMD ["/app/start-hf.sh"]