Update Dockerfile
Browse files- Dockerfile +26 -20
Dockerfile
CHANGED
@@ -1,20 +1,26 @@
|
|
1 |
-
# Use an official Python runtime as a parent image
|
2 |
-
FROM python:3.9-slim
|
3 |
-
|
4 |
-
# Set the working directory in the container
|
5 |
-
WORKDIR /app
|
6 |
-
|
7 |
-
#
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
# Copy the
|
14 |
-
COPY . /app
|
15 |
-
|
16 |
-
#
|
17 |
-
|
18 |
-
|
19 |
-
#
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Install system dependencies needed for building some Python packages
|
8 |
+
RUN apt-get update && apt-get install -y \
|
9 |
+
cmake \
|
10 |
+
build-essential \
|
11 |
+
&& rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
+
# Copy the requirements file into the container at /app
|
14 |
+
COPY requirements.txt /app/requirements.txt
|
15 |
+
|
16 |
+
# Install any needed packages specified in requirements.txt
|
17 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt
|
18 |
+
|
19 |
+
# Copy the rest of the application code to /app
|
20 |
+
COPY . /app
|
21 |
+
|
22 |
+
# Expose port 8000 to the outside world
|
23 |
+
EXPOSE 8000
|
24 |
+
|
25 |
+
# Command to run the FastAPI application using Uvicorn
|
26 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|