Update Dockerfile
Browse files- Dockerfile +14 -7
Dockerfile
CHANGED
|
@@ -1,16 +1,23 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
|
|
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
RUN pip install --no-cache-dir --upgrade pip
|
| 8 |
-
RUN pip install --no-cache-dir --upgrade curl_cffi
|
| 9 |
-
|
| 10 |
-
# Then, install the rest of your requirements
|
| 11 |
COPY requirements.txt .
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
|
|
|
| 16 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 1 |
+
|
| 2 |
+
# Use an official Python runtime that supports modern type hinting
|
| 3 |
FROM python:3.10-slim
|
| 4 |
|
| 5 |
+
# Set the working directory in the container
|
| 6 |
WORKDIR /app
|
| 7 |
|
| 8 |
+
# Copy the requirements file into the container at /app
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
COPY requirements.txt .
|
| 10 |
+
|
| 11 |
+
|
| 12 |
+
# Install any needed packages specified in requirements.txt
|
| 13 |
+
|
| 14 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 15 |
|
| 16 |
+
# Copy the main application file into the container at /app
|
| 17 |
+
COPY main.py .
|
| 18 |
+
|
| 19 |
+
# Make port 8000 available to the world outside this container
|
| 20 |
+
EXPOSE 8000
|
| 21 |
|
| 22 |
+
# Run main.py when the container launches
|
| 23 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|