Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +23 -4
Dockerfile
CHANGED
|
@@ -1,12 +1,31 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
|
|
|
|
|
|
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/apiHandler.js
|
| 9 |
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/api_keys.txt
|
| 10 |
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/server.js
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
# Install dependencies
|
| 18 |
+
RUN npm install
|
| 19 |
+
|
| 20 |
+
# Copy the application code with correct ownership
|
| 21 |
+
COPY --chown=node:node . .
|
| 22 |
|
| 23 |
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/apiHandler.js
|
| 24 |
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/api_keys.txt
|
| 25 |
RUN wget https://huggingface.co/datasets/API-Handler/unlim-openai/resolve/main/server.js
|
| 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"]
|