OrbitMC commited on
Commit
d6562dd
·
verified ·
1 Parent(s): 8a435e3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,15 +1,16 @@
1
- FROM python:3.9-slim
2
 
3
- WORKDIR /app
4
 
5
- # Install dependencies
6
- RUN pip install --no-cache-dir flask flask-socketio eventlet gunicorn
7
 
8
- # Copy the application
9
- COPY app.py .
10
 
11
- # Expose the port
12
- EXPOSE 7860
13
 
14
- # Run with Gunicorn/Eventlet for WebSocket support
15
- CMD ["gunicorn", "--worker-class", "eventlet", "-w", "1", "--bind", "0.0.0.0:7860", "app:app"]
 
 
 
 
 
1
+ FROM python:3.9
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
+ # Create a directory for persistent storage (optional but good practice)
12
+ RUN mkdir -p /data
13
+ # Give permission to write json file
14
+ RUN chmod 777 /data
15
+
16
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]