File size: 853 Bytes
effc62f
 
1869a0e
effc62f
 
1869a0e
 
 
a5f67d6
1869a0e
 
 
 
effc62f
1869a0e
 
effc62f
1869a0e
 
effc62f
1869a0e
 
e67b323
1869a0e
 
01e5f06
45d8158
 
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
FROM python:3.10-slim

# Set working directory in the container
WORKDIR /app

# Copy requirements and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Create group and non-root user for HF Spaces, then make /app writable
RUN addgroup --gid 1000 user && \
    adduser --disabled-password --gecos '' --uid 1000 --gid 1000 user && \
    chown -R user:user /app

# Copy application files
COPY . .

# Switch to non-root user
USER user

# Expose Streamlit port
EXPOSE 8501

# Health check for Streamlit
HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

# Run MCP servers in background, then Streamlit (using shell for &)
CMD sh -c "python /app/arithmetic_server.py & python /app/stock_server.py & sleep 5 && streamlit run /app/frontend.py --server.port=8501 --server.address=0.0.0.0"