Update Dockerfile
Browse files- Dockerfile +23 -2
Dockerfile
CHANGED
@@ -1,2 +1,23 @@
|
|
1 |
-
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Start with an official Python image as the base image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory inside the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the requirements.txt file into the container
|
8 |
+
COPY requirements.txt /app/
|
9 |
+
|
10 |
+
# Install the required Python dependencies
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
12 |
+
|
13 |
+
# Copy the rest of the application code into the container
|
14 |
+
COPY . /app/
|
15 |
+
|
16 |
+
# Expose the port that FastAPI will run on
|
17 |
+
EXPOSE 8000
|
18 |
+
|
19 |
+
# Set the environment variable to tell FastAPI that we're running in production mode
|
20 |
+
ENV ENV=production
|
21 |
+
|
22 |
+
# Run the FastAPI app with Uvicorn as the server
|
23 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|