File size: 799 Bytes
6c44b92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# 1. Base Image: Lightweight Python version
FROM python:3.10-slim

# 2. Hugging Face Security Requirement: Run as non-root user
RUN useradd -m -u 1000 user

USER user


# 3. Set Environment Variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONDONTWRITEBYTECODE=1 \
    PYTHONUNBUFFERED=1 \
    CREWAI_TELEMETRY_OPT_OUT=true

# 4. Set Work Directory inside the user's home folder
WORKDIR $HOME/app

# 5. Copy and Install Dependencies
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 6. Copy Application Code
COPY --chown=user . .

# 7. Expose Hugging Face Default Port
EXPOSE 7860

# 8. Command to Run the Streamlit App
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]