mgbam commited on
Commit
0ceb4df
·
verified ·
1 Parent(s): 9314d21

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -15
Dockerfile CHANGED
@@ -1,31 +1,48 @@
 
1
  FROM python:3.10-slim
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  ENV PYTHONDONTWRITEBYTECODE=1
3
  ENV PYTHONUNBUFFERED=1
 
 
4
 
5
- # Add this
6
- ENV HOME /app
7
- ENV STREAMLIT_CONFIG_DIR /app/.streamlit
8
-
9
- # Create and set working directory
10
  WORKDIR /app
11
 
12
- # Install system dependencies (if any required for MCP endpoints)
13
  RUN apt-get update && \
14
  apt-get install -y --no-install-recommends \
15
- build-essential \
16
- curl \
17
  && rm -rf /var/lib/apt/lists/*
18
 
19
  # Copy requirements and install Python dependencies
20
- COPY requirements.txt ./
21
- RUN pip install --upgrade pip && \
22
- pip install --no-cache-dir -r requirements.txt
23
 
24
- # Copy application source
25
  COPY . .
26
 
27
- # Expose port for Streamlit (default 8501) and any API endpoints
 
 
 
 
 
 
28
  EXPOSE 8501
29
 
30
- # Default command to run the Streamlit app
31
- CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]
 
1
+ # Use official Python base image
2
  FROM python:3.10-slim
3
+
4
+ # App metadata (for Hugging Face Spaces Docker SDK)
5
+ LABEL title="MCP Research"
6
+ LABEL emoji="🚀"
7
+ LABEL colorFrom="red"
8
+ LABEL colorTo="red"
9
+ LABEL sdk="docker"
10
+ LABEL app_port="8501"
11
+ LABEL tags="streamlit"
12
+ LABEL pinned="false"
13
+ LABEL short_description="Streamlit template space"
14
+
15
+ # Set environment variables for permissions and Streamlit config
16
  ENV PYTHONDONTWRITEBYTECODE=1
17
  ENV PYTHONUNBUFFERED=1
18
+ ENV HOME=/app
19
+ ENV STREAMLIT_CONFIG_DIR=/app/.streamlit
20
 
21
+ # Create working directory
 
 
 
 
22
  WORKDIR /app
23
 
24
+ # System deps (edit as needed for your MCP servers)
25
  RUN apt-get update && \
26
  apt-get install -y --no-install-recommends \
27
+ build-essential \
28
+ curl \
29
  && rm -rf /var/lib/apt/lists/*
30
 
31
  # Copy requirements and install Python dependencies
32
+ COPY requirements.txt .
33
+ RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
 
34
 
35
+ # Copy the rest of your code
36
  COPY . .
37
 
38
+ # Create .streamlit directory to avoid permission issues
39
+ RUN mkdir -p /app/.streamlit
40
+
41
+ # Optionally, add default Streamlit config (no telemetry, etc)
42
+ RUN echo \"[server]\\nheadless = true\\nport = 8501\\naddress = 0.0.0.0\\n\" > /app/.streamlit/config.toml
43
+
44
+ # Expose Streamlit's default port
45
  EXPOSE 8501
46
 
47
+ # Start the Streamlit app
48
+ CMD [\"streamlit\", \"run\", \"app.py\", \"--server.port=8501\", \"--server.address=0.0.0.0\"]