API-Handler commited on
Commit
a4169d0
·
verified ·
1 Parent(s): b0494b3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -31
Dockerfile CHANGED
@@ -1,31 +1,15 @@
1
- # Use Node.js LTS version
2
- FROM node:18-slim
3
-
4
- # Switch to the "node" user for security
5
- USER node
6
-
7
- # Set home to the user's home directory and add local bin to PATH
8
- ENV HOME=/home/node \
9
- PATH=/home/node/.local/bin:$PATH
10
-
11
- # Set the working directory to the user's home directory
12
- WORKDIR $HOME/app
13
-
14
- # Copy package files with correct ownership
15
- COPY --chown=node:node package*.json ./
16
-
17
- RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/apiHandler.js
18
- RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/api_keys.txt
19
- RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/server.js
20
-
21
- # Install dependencies
22
- RUN npm install
23
-
24
- # Copy the application code with correct ownership
25
- COPY --chown=node:node . .
26
-
27
- # Expose port 7860 (required for Hugging Face Spaces)
28
- EXPOSE 7860
29
-
30
- # Start the application using Node.js
31
- CMD ["node", "server.js"]
 
1
+ FROM python:3.10
2
+
3
+ WORKDIR /code
4
+
5
+ COPY ./requirements.txt /code/requirements.txt
6
+
7
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
+
9
+ COPY . .
10
+
11
+ RUN wget https://huggingface.co/datasets/DevsDoCode/openai/resolve/main/api_handler.py
12
+ RUN wget https://huggingface.co/datasets/DevsDoCode/openai/resolve/main/main.py
13
+ RUN wget https://huggingface.co/datasets/DevsDoCode/openai/resolve/main/models.py
14
+
15
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]