added backend environment in docker

This commit is contained in:
tcsenpai 2025-05-02 23:22:33 +02:00
parent d6ec56b5df
commit eda277aa54
2 changed files with 52 additions and 1 deletions

35
Dockerfile.python-env Normal file
View File

@ -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

View File

@ -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.