Update Dockerfile
Browse files- Dockerfile +9 -27
Dockerfile
CHANGED
|
@@ -1,32 +1,6 @@
|
|
| 1 |
# Use the official Python 3.10.9 image as the base
|
| 2 |
FROM python:3.10.9
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
| 5 |
-
# These are required for various Python packages and functionalities
|
| 6 |
-
# RUN apt-get update && apt-get install -y \
|
| 7 |
-
# libwoff1 \
|
| 8 |
-
# libopus0 \
|
| 9 |
-
# libwebp6 \
|
| 10 |
-
# libwebpdemux2 \
|
| 11 |
-
# libenchant1c2a \
|
| 12 |
-
# libgudev-1.0-0 \
|
| 13 |
-
# libsecret-1-0 \
|
| 14 |
-
# libhyphen0 \
|
| 15 |
-
# libgdk-pixbuf2.0-0 \
|
| 16 |
-
# libegl1 \
|
| 17 |
-
# libnotify4 \
|
| 18 |
-
# libxslt1.1 \
|
| 19 |
-
# libevent-2.1-7 \
|
| 20 |
-
# libgles2 \
|
| 21 |
-
# libvpx6 \
|
| 22 |
-
# libxcomposite1 \
|
| 23 |
-
# libatk1.0-0 \
|
| 24 |
-
# libatk-bridge2.0-0 \
|
| 25 |
-
# libepoxy0 \
|
| 26 |
-
# libgtk-3-0 \
|
| 27 |
-
# libharfbuzz-icu0 \
|
| 28 |
-
# && rm -rf /var/lib/apt/lists/*
|
| 29 |
-
|
| 30 |
# Set the working directory in the container
|
| 31 |
WORKDIR /app
|
| 32 |
|
|
@@ -36,9 +10,15 @@ COPY requirements.txt .
|
|
| 36 |
# Install Python dependencies
|
| 37 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
# Install Playwright browsers
|
| 40 |
RUN playwright install
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
# Copy the current directory contents into the container
|
| 43 |
COPY . .
|
| 44 |
|
|
@@ -48,6 +28,8 @@ RUN chmod -R 755 /app
|
|
| 48 |
# Expose the port the app runs on
|
| 49 |
EXPOSE 8000
|
| 50 |
|
| 51 |
-
#
|
|
|
|
|
|
|
| 52 |
# Command to run the FastAPI application
|
| 53 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|
|
| 1 |
# Use the official Python 3.10.9 image as the base
|
| 2 |
FROM python:3.10.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Set the working directory in the container
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
| 10 |
# Install Python dependencies
|
| 11 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 12 |
|
| 13 |
+
# Install additional required packages
|
| 14 |
+
RUN pip install crawl4ai nest-asyncio
|
| 15 |
+
|
| 16 |
# Install Playwright browsers
|
| 17 |
RUN playwright install
|
| 18 |
|
| 19 |
+
# Create the .crawl4ai directory with correct permissions
|
| 20 |
+
RUN mkdir /.crawl4ai && chmod 777 /.crawl4ai
|
| 21 |
+
|
| 22 |
# Copy the current directory contents into the container
|
| 23 |
COPY . .
|
| 24 |
|
|
|
|
| 28 |
# Expose the port the app runs on
|
| 29 |
EXPOSE 8000
|
| 30 |
|
| 31 |
+
# Set environment variable to use the created directory
|
| 32 |
+
ENV CRAWL4AI_DB_PATH=/.crawl4ai
|
| 33 |
+
|
| 34 |
# Command to run the FastAPI application
|
| 35 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|