Spaces:
Paused
Paused
Upload 7 files
Browse files- Dockerfile +8 -2
- projects/projects.txt' +0 -0
- server.py +2 -1
Dockerfile
CHANGED
|
@@ -16,8 +16,14 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 16 |
# Copy the application code
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# Command to run the application
|
| 23 |
CMD ["python", "server.py"]
|
|
|
|
| 16 |
# Copy the application code
|
| 17 |
COPY . .
|
| 18 |
|
| 19 |
+
# Hugging Face Spaces require running as a non-root user
|
| 20 |
+
# and giving them permissions to the working directory
|
| 21 |
+
RUN useradd -m -u 1000 user
|
| 22 |
+
RUN chown -R user:user /app
|
| 23 |
+
USER user
|
| 24 |
+
|
| 25 |
+
# Expose the standard Hugging Face Spaces port
|
| 26 |
+
EXPOSE 7860
|
| 27 |
|
| 28 |
# Command to run the application
|
| 29 |
CMD ["python", "server.py"]
|
projects/projects.txt'
ADDED
|
File without changes
|
server.py
CHANGED
|
@@ -98,4 +98,5 @@ async def websocket_endpoint(websocket: WebSocket):
|
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
import uvicorn
|
| 101 |
-
|
|
|
|
|
|
| 98 |
|
| 99 |
if __name__ == "__main__":
|
| 100 |
import uvicorn
|
| 101 |
+
# Hugging Face Spaces expose port 7860 by default
|
| 102 |
+
uvicorn.run(app, host="0.0.0.0", port=7860)
|