File size: 1,614 Bytes
0ceb4df
c5f122f
0ceb4df
f648aaa
0ceb4df
 
 
 
 
 
 
 
 
 
f648aaa
c5f122f
 
0ceb4df
 
c5f122f
f648aaa
d6b2a9a
 
f648aaa
c5f122f
 
0ceb4df
 
d6b2a9a
 
c5f122f
0ceb4df
 
d6b2a9a
f648aaa
c5f122f
d6b2a9a
f648aaa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d6b2a9a
 
f648aaa
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# Use official Python base image
FROM python:3.10-slim

# App metadata for Hugging Face Spaces Docker SDK
LABEL title="MCP Research"
LABEL emoji="πŸš€"
LABEL colorFrom="red"
LABEL colorTo="red"
LABEL sdk="docker"
LABEL app_port="8501"
LABEL tags="streamlit"
LABEL pinned="false"
LABEL short_description="Streamlit template space"

# Set environment variables for Streamlit config and permissions
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV HOME=/app
ENV STREAMLIT_CONFIG_DIR=/app/.streamlit

# Set working directory
WORKDIR /app

# System dependencies (edit as needed)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
      build-essential \
      curl \
    && rm -rf /var/lib/apt/lists/*

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

# Copy all app source
COPY . .

# Create .streamlit directory and set permissions
RUN mkdir -p /app/.streamlit && chmod -R 777 /app/.streamlit

# Add a default Streamlit config.toml (overwrite with your own if needed)
RUN echo "\
[server]\n\
headless = true\n\
port = 8501\n\
address = \"0.0.0.0\"\n\
enableCORS = false\n\
enableXsrfProtection = false\n\
\n\
[theme]\n\
primaryColor = \"#e63946\"\n\
backgroundColor = \"#0E1117\"\n\
secondaryBackgroundColor = \"#1a1a2e\"\n\
textColor = \"#FAFAFA\"\n\
font = \"sans serif\"\n\
" > /app/.streamlit/config.toml

# Expose the Streamlit port
EXPOSE 8501

# Use shell-form CMD for Hugging Face Spaces compatibility
CMD streamlit run app.py --server.port=8501 --server.address=0.0.0.0