diff --git a/Dockerfile.python-env b/Dockerfile.python-env new file mode 100644 index 0000000..0c5c12b --- /dev/null +++ b/Dockerfile.python-env @@ -0,0 +1,35 @@ +FROM ubuntu:22.04 + +# Set working directory +WORKDIR /app + +# Install system dependencies +RUN apt-get update && \ + apt-get install -y \ + python3-dev \ + python3-pip \ + python3-wheel \ + build-essential \ + alsa-utils \ + portaudio19-dev \ + libgtk-3-dev \ + libnotify-dev \ + libgconf-2-4 \ + libnss3 \ + libxss1 && \ + rm -rf /var/lib/apt/lists/* + +# Upgrade pip and install Python packages +RUN pip3 install --upgrade pip setuptools wheel && \ + pip3 install selenium + +# Copy requirements.txt first to leverage Docker cache +COPY requirements.txt . +RUN pip3 install -r requirements.txt --no-cache-dir + +# Copy the rest of the application +COPY . . + +# Set environment variables for Chrome paths with defaults +ENV CHROME_EXECUTABLE_PATH=/app/chrome_bundle/chrome136/chrome-linux64/chrome +ENV CHROMEDRIVER_PATH=/app/chrome_bundle/chrome136/chromedriver \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index beb89c8..63879b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -65,7 +65,23 @@ services: - REACT_APP_BACKEND_URL=http://0.0.0.0:${BACKEND_PORT:-8000} networks: - agentic-seek-net - + + python-env: + container_name: python-env + build: + context: . + dockerfile: Dockerfile.python-env + ports: + - ${BACKEND_PORT:-8000}:${BACKEND_PORT:-8000} + volumes: + - ./:/app + - ${WORK_DIR}:${WORK_DIR} + command: python3 api.py + environment: + - SEARXNG_URL=http://localhost:8080 + - WORK_DIR=${WORK_DIR} + network_mode: "host" + # NOTE: backend service is not working yet due to issue with chromedriver on docker. # Therefore backend is run on host machine. # Open to pull requests to fix this.