truegleai commited on
Commit
561e31f
·
verified ·
1 Parent(s): b1434df

Deploy FastAPI server with CodeLlama 7B

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -0
Dockerfile ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for HuggingFace Spaces
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y \
9
+ build-essential \
10
+ curl \
11
+ git \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy requirements and install Python dependencies
15
+ COPY api_requirements.txt requirements.txt
16
+ RUN pip install --no-cache-dir --upgrade pip && \
17
+ pip install --no-cache-dir -r requirements.txt
18
+
19
+ # Copy application code
20
+ COPY api_app.py app.py
21
+
22
+ # Expose port (HF Spaces uses 7860)
23
+ EXPOSE 7860
24
+
25
+ # Health check
26
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
27
+ CMD curl -f http://localhost:7860/health || exit 1
28
+
29
+ # Run the FastAPI app
30
+ CMD ["python", "app.py"]