ChiragPatankar commited on
Commit
f6597e9
·
verified ·
1 Parent(s): 066678d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +22 -13
Dockerfile CHANGED
@@ -1,26 +1,35 @@
1
- # Use slim Python image
2
- FROM python:3.11-slim
3
 
4
  # Set working directory
5
  WORKDIR /app
6
 
7
- # Install system dependencies (for psycopg2 and bcrypt)
8
  RUN apt-get update && apt-get install -y \
9
  gcc \
10
- libpq-dev \
11
- build-essential \
12
- libffi-dev \
13
- libssl-dev \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
- # Copy your app files
17
- COPY . /app
18
 
19
  # Install Python dependencies
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # Expose the default port for Hugging Face Spaces
23
- EXPOSE 7860
24
 
25
- # Start your FastAPI app
26
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.9-slim
 
2
 
3
  # Set working directory
4
  WORKDIR /app
5
 
6
+ # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  gcc \
 
 
 
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements first for better caching
12
+ COPY requirements.txt .
13
 
14
  # Install Python dependencies
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Copy application code
18
+ COPY . .
19
 
20
+ # Create directory for SQLite database
21
+ RUN mkdir -p /app/data
22
+
23
+ # Set environment variables
24
+ ENV PYTHONPATH=/app
25
+ ENV DATABASE_URL=sqlite:///./data/mcp_server.db
26
+
27
+ # Expose port
28
+ EXPOSE 8000
29
+
30
+ # Health check
31
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
32
+ CMD curl -f http://localhost:8000/mcp/health || exit 1
33
+
34
+ # Run the application
35
+ CMD ["python", "app.py"]