AItool commited on
Commit
2968df2
·
verified ·
1 Parent(s): 156e138

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -4
Dockerfile CHANGED
@@ -1,16 +1,28 @@
1
- FROM python:3.10-slim
 
 
2
  RUN pip install --no-cache-dir --upgrade pip
3
 
4
  WORKDIR /app
 
 
5
  COPY . .
6
 
7
- # Install only what's on PyPI
 
 
 
 
8
  RUN pip install --no-cache-dir -r requirements.txt
9
 
10
- # Make src/ importable without installing
11
  ENV PYTHONPATH=/app/src
12
 
 
13
  EXPOSE 5001
14
- CMD ["uvicorn","main:app","--host","0.0.0.0","--port","5001"]
 
 
 
15
 
16
 
 
1
+ FROM python:3.11-slim
2
+
3
+ # 1) bump pip so installs are smoother
4
  RUN pip install --no-cache-dir --upgrade pip
5
 
6
  WORKDIR /app
7
+
8
+ # 2) copy everything in your repo
9
  COPY . .
10
 
11
+ # 3) create the data folder & make it world-writable ⬅️
12
+ RUN mkdir -p data \
13
+ && chmod 777 data
14
+
15
+ # 4) install your Python deps
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
+ # 5) ensure your src/ code is on PYTHONPATH (if you’re not pip-installing it) ⬅️
19
  ENV PYTHONPATH=/app/src
20
 
21
+ # 6) expose your FastAPI port
22
  EXPOSE 5001
23
+
24
+ # 7) launch Uvicorn
25
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5001"]
26
+
27
 
28