File size: 652 Bytes
cbd0ecc
 
 
 
 
 
 
 
f7003b3
cbd0ecc
 
 
 
 
 
 
 
 
 
 
a2663e3
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 1. Base Python image
FROM python:3.11-slim

# 2. Create a non-root user (HF likes this pattern)
RUN useradd -m -u 1000 user
USER user

# 3. Set working directory
WORKDIR /
# 4. Copy dependency file and install deps
COPY --chown=user requirements.txt .
RUN python3 -m pip install --no-cache-dir -r requirements.txt

# 5. Copy the rest of the code
COPY --chown=user . .

# 6. Expose the port your app will listen on
EXPOSE 7860

# 7. Start the app
#CMD [ "python3","-m", "uvicorn", "src.app.app:app", "--host", "0.0.0.0", "--port", "7860"]
CMD ["/bin/sh", "-c", ". ./env_config.sh && exec python3 -m uvicorn src.app.app:app --host 0.0.0.0 --port 7860"]