File size: 740 Bytes
e8e640f
 
b707cd3
e8e640f
 
 
 
b707cd3
e8e640f
 
b707cd3
e8e640f
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Use an official lightweight Python image
FROM python:3.10-slim

# Hugging Face Spaces require the app to run as user '1000'
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory inside the container
WORKDIR /app

# Copy all your local files into the container
COPY --chown=user . /app

# Install all your Python packages
RUN pip install --no-cache-dir -r requirements.txt

# Expose port 7860
EXPOSE 7860

# BYPASS run.sh and run everything directly in the Docker CMD
# This prevents the Windows/Linux invisible character crash
CMD ["bash", "-c", "uvicorn api.main:app --host 127.0.0.1 --port 8000 & sleep 10 && streamlit run frontend/app.py --server.port 7860 --server.address 0.0.0.0"]