Spaces:
Running
Running
Dockerfile
Browse files- Dockerfile +23 -0
Dockerfile
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM python:3.9-slim
|
2 |
+
|
3 |
+
# Set working directory
|
4 |
+
WORKDIR /app
|
5 |
+
|
6 |
+
# Copy requirements first to leverage Docker cache
|
7 |
+
COPY requirements.txt .
|
8 |
+
|
9 |
+
# Install dependencies
|
10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
11 |
+
|
12 |
+
# Copy application code
|
13 |
+
COPY app.py .
|
14 |
+
|
15 |
+
# Set environment variables
|
16 |
+
ENV HOST=0.0.0.0
|
17 |
+
ENV PORT=7860
|
18 |
+
|
19 |
+
# Expose the port the app runs on
|
20 |
+
EXPOSE 7860
|
21 |
+
|
22 |
+
# Command to run the application
|
23 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|