Upload Dockerfile with huggingface_hub
Browse files- Dockerfile +22 -0
Dockerfile
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a lightweight Python base image
|
2 |
+
FROM python:3.9-slim-buster
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy requirements.txt and install dependencies first
|
8 |
+
COPY requirements.txt .
|
9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
10 |
+
|
11 |
+
# Copy your model directory
|
12 |
+
COPY model ./model
|
13 |
+
|
14 |
+
# Copy your FastAPI application code
|
15 |
+
COPY app.py .
|
16 |
+
|
17 |
+
# Set the port that the application will run on inside the container
|
18 |
+
ENV PORT 7860
|
19 |
+
EXPOSE ${PORT}
|
20 |
+
|
21 |
+
# Command to run your FastAPI application with Uvicorn
|
22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|