Update Dockerfile
Browse files- Dockerfile +10 -19
Dockerfile
CHANGED
|
@@ -1,29 +1,20 @@
|
|
| 1 |
-
#
|
| 2 |
-
FROM python:3.
|
| 3 |
|
| 4 |
-
# Set
|
| 5 |
-
ENV PYTHONDONTWRITEBYTECODE=1
|
| 6 |
-
ENV PYTHONUNBUFFERED=1
|
| 7 |
-
|
| 8 |
-
# Set the working directory to /app
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
# For example, if you need gcc for some packages, uncomment the following line
|
| 13 |
-
# RUN apt-get update && apt-get install -y gcc
|
| 14 |
-
|
| 15 |
-
# Copy only the requirements.txt first to leverage Docker cache
|
| 16 |
COPY requirements.txt .
|
| 17 |
|
| 18 |
-
# Install
|
| 19 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copy the
|
| 23 |
COPY . .
|
| 24 |
|
| 25 |
-
# Expose port
|
| 26 |
-
EXPOSE
|
| 27 |
|
| 28 |
-
# Command to run the
|
| 29 |
-
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "
|
|
|
|
| 1 |
+
# Dockerfile
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
|
| 4 |
+
# Set the working directory in the container
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy the requirements file into the container
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY requirements.txt .
|
| 9 |
|
| 10 |
+
# Install the dependencies
|
|
|
|
| 11 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 12 |
|
| 13 |
+
# Copy the application code into the container
|
| 14 |
COPY . .
|
| 15 |
|
| 16 |
+
# Expose the port that the app runs on
|
| 17 |
+
EXPOSE 8000
|
| 18 |
|
| 19 |
+
# Command to run the application
|
| 20 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
|