pierreramez commited on
Commit
6b940c7
·
verified ·
1 Parent(s): e6bb905

Update DockerFile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -14
Dockerfile CHANGED
@@ -1,20 +1,19 @@
1
- FROM python:3.10-slim
 
2
 
3
- WORKDIR /app
 
4
 
5
- RUN apt-get update && apt-get install -y \
6
- git \
7
- curl \
8
- && rm -rf /var/lib/apt/lists/*
9
 
10
- COPY backend_requirements.txt requirements.txt
 
11
 
12
- RUN pip install --no-cache-dir -r requirements.txt
13
-
14
- COPY fastapi_backend.py app.py
15
-
16
- RUN mkdir -p /app/data
17
-
18
- EXPOSE 7860
19
 
 
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use Python 3.10
2
+ FROM python:3.10
3
 
4
+ # Set working directory
5
+ WORKDIR /code
6
 
7
+ # Copy requirements and install
8
+ COPY ./requirements.txt /code/requirements.txt
9
+ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
 
10
 
11
+ # Create the data directory and set permissions (Crucial for writing feedback.jsonl)
12
+ RUN mkdir -p /code/data && chmod 777 /code/data
13
 
14
+ # Copy the application code
15
+ # FIX: We copy 'app.py' specifically, correcting your build error
16
+ COPY ./app.py /code/app.py
 
 
 
 
17
 
18
+ # Run the application
19
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]