Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- src/Dockerfile +21 -0
src/Dockerfile
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the official Python image as a parent image
|
| 2 |
+
FROM python:3.11.3-slim
|
| 3 |
+
|
| 4 |
+
# Set the working directory within the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Copy your FastAPI application code into the container
|
| 8 |
+
COPY src/app.py /app
|
| 9 |
+
|
| 10 |
+
# Copy the requirements.txt file into the container
|
| 11 |
+
COPY requirements.txt /app
|
| 12 |
+
|
| 13 |
+
# Install the Python dependencies
|
| 14 |
+
RUN pip install -r /app/requirements.txt
|
| 15 |
+
|
| 16 |
+
# Expose port 8000 for the FastAPI application
|
| 17 |
+
EXPOSE 8000
|
| 18 |
+
|
| 19 |
+
# Define the command to run your FastAPI application
|
| 20 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|
| 21 |
+
|