File size: 1,047 Bytes
160a06b
 
a4169d0
c00403c
 
 
 
160a06b
 
a4169d0
160a06b
 
 
a4169d0
160a06b
 
 
 
 
 
 
 
 
 
 
9292941
c00403c
 
 
 
a4169d0
160a06b
 
 
 
 
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
# Use Node.js LTS version
FROM node:18-slim

# Install wget
USER root
RUN apt-get update && apt-get install -y wget && rm -rf /var/lib/apt/lists/*

# Switch to the "node" user for security
USER node

# Set home to the user's home directory and add local bin to PATH
ENV HOME=/home/node \
    PATH=/home/node/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Copy package files with correct ownership
COPY --chown=node:node package*.json ./

# Install dependencies
RUN npm install

# Copy the application code with correct ownership
COPY --chown=node:node . .

# Download required files
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/apiHandler.js && \
    wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/api_keys.txt && \
    wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/server.js

# Expose port 7860 (required for Hugging Face Spaces)
EXPOSE 7860

# Start the application using Node.js
CMD ["node", "server.js"]