Spaces:
Sleeping
Sleeping
diabolic6045
commited on
Commit
•
ab7b556
1
Parent(s):
77873df
Create Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use Python 3.11 slim image as base
|
2 |
+
FROM python:3.11-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 |
+
&& rm -rf /var/lib/apt/lists/*
|
11 |
+
|
12 |
+
# Copy requirements first to leverage Docker cache
|
13 |
+
COPY requirements.txt .
|
14 |
+
|
15 |
+
# Install Python dependencies
|
16 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
+
|
18 |
+
# Copy the application code
|
19 |
+
COPY ./api ./api
|
20 |
+
COPY ./vercel.json .
|
21 |
+
|
22 |
+
# Set environment variables
|
23 |
+
ENV PYTHONUNBUFFERED=1
|
24 |
+
ENV HOST=0.0.0.0
|
25 |
+
ENV PORT=7860
|
26 |
+
|
27 |
+
# Expose the port Hugging Face Spaces expects
|
28 |
+
EXPOSE 7860
|
29 |
+
|
30 |
+
# Command to run the application
|
31 |
+
CMD ["python", "api/app.py"]
|