Percy3822 commited on
Commit
5b961d7
·
verified ·
1 Parent(s): c114434

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -7
Dockerfile CHANGED
@@ -1,17 +1,27 @@
1
  FROM python:3.10-slim
2
 
3
- ENV DEBIAN_FRONTEND=noninteractive \
4
- PYTHONDONTWRITEBYTECODE=1 \
5
- PYTHONUNBUFFERED=1
6
 
 
7
  WORKDIR /code
8
 
9
- # Install Python deps
 
 
 
 
 
10
  COPY requirements.txt .
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
- # Copy app + static UI
14
- COPY . .
 
 
 
15
 
16
  EXPOSE 7860
17
- CMD ["uvicorn","app:app","--host","0.0.0.0","--port","7860"]
 
 
1
  FROM python:3.10-slim
2
 
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1 \
5
+ PORT=7860
6
 
7
+ # Workdir
8
  WORKDIR /code
9
 
10
+ # System deps (just in case)
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ ca-certificates curl && \
13
+ rm -rf /var/lib/apt/lists/*
14
+
15
+ # App files
16
  COPY requirements.txt .
17
  RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Ensure writable data dir for memory/cache
20
+ RUN mkdir -p /data && chmod -R 777 /data
21
+
22
+ COPY app.py /code/app.py
23
+ COPY static /code/static
24
 
25
  EXPOSE 7860
26
+
27
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--proxy-headers"]