Update Dockerfile
Browse files- Dockerfile +22 -32
Dockerfile
CHANGED
|
@@ -1,32 +1,22 @@
|
|
| 1 |
-
# Use the official Python image as base
|
| 2 |
-
FROM python:3.11-slim
|
| 3 |
-
|
| 4 |
-
# Install OS dependencies for Playwright and Chromium
|
| 5 |
-
RUN apt-get update && apt-get install -y \
|
| 6 |
-
wget gnupg curl unzip \
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
#
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
RUN pip install fastapi uvicorn playwright nest_asyncio
|
| 24 |
-
|
| 25 |
-
# Install Playwright browsers (Chromium only)
|
| 26 |
-
RUN playwright install --with-deps chromium
|
| 27 |
-
|
| 28 |
-
# Expose the FastAPI port
|
| 29 |
-
EXPOSE 8000
|
| 30 |
-
|
| 31 |
-
# Command to run the FastAPI app
|
| 32 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 1 |
+
# Use the official Python image as base
|
| 2 |
+
FROM python:3.11-slim
|
| 3 |
+
|
| 4 |
+
# Install OS dependencies for Playwright and Chromium
|
| 5 |
+
RUN apt-get update && apt-get install -y \
|
| 6 |
+
wget gnupg curl unzip \
|
| 7 |
+
|
| 8 |
+
# Set work directory
|
| 9 |
+
WORKDIR /app
|
| 10 |
+
|
| 11 |
+
# Copy project files
|
| 12 |
+
COPY . .
|
| 13 |
+
|
| 14 |
+
# Install Python dependencies
|
| 15 |
+
RUN pip install --upgrade pip
|
| 16 |
+
RUN pip install fastapi uvicorn playwright nest_asyncio
|
| 17 |
+
|
| 18 |
+
# Install Playwright browsers (Chromium only)
|
| 19 |
+
RUN playwright install --with-deps chromium
|
| 20 |
+
|
| 21 |
+
COPY --chown=user . /app
|
| 22 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|