Spaces:
Runtime error
Runtime error
Create Dockerfile
Browse files- Dockerfile +31 -0
Dockerfile
ADDED
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
+
|
3 |
+
# Set working directory
|
4 |
+
WORKDIR /code
|
5 |
+
|
6 |
+
# Install system dependencies
|
7 |
+
RUN apt-get update && apt-get install -y \
|
8 |
+
build-essential \
|
9 |
+
git \
|
10 |
+
curl \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
+
# Copy requirements and install
|
14 |
+
COPY app/requirements.txt .
|
15 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
16 |
+
|
17 |
+
# Copy the entire app folder
|
18 |
+
COPY app/ ./app/
|
19 |
+
|
20 |
+
# Set the working directory to app/
|
21 |
+
WORKDIR /code/app
|
22 |
+
|
23 |
+
# Expose the port
|
24 |
+
EXPOSE 7860
|
25 |
+
|
26 |
+
# Environment variables (optional)
|
27 |
+
ENV HOST=0.0.0.0
|
28 |
+
ENV PORT=7860
|
29 |
+
|
30 |
+
# Run the FastAPI app
|
31 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|