File size: 810 Bytes
a74837e
 
 
 
 
 
 
 
 
 
 
 
 
06190d1
 
a74837e
06190d1
 
a74837e
fa7d18c
a74837e
06190d1
a74837e
06190d1
 
a74837e
23a78d8
 
097f2e1
 
a74837e
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#FROM python:3.11

#WORKDIR /app

#COPY requirements.txt .
#RUN pip install -r requirements.txt

#COPY . .

#CMD ["uvicorn","app.main:app","--host","0.0.0.0","--port","7860"]



FROM python:3.11

# Inside the container, we'll work from /app. This is just a path.
WORKDIR /app

# Install dependencies first (better layer caching)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy your source files
COPY . .

# Helpful envs
ENV PYTHONUNBUFFERED=1 \
    PYTHONDONTWRITEBYTECODE=1
    
RUN mkdir -p /data && chmod -R 777 /data

# Expose your port (change if you prefer 8000)
EXPOSE 7860

# Run Uvicorn pointing to your ASGI app in main.py
# Using `python -m uvicorn` is more reliable in containers
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]