diff --git a/Dockerfile b/Dockerfile.backend similarity index 50% rename from Dockerfile rename to Dockerfile.backend index 6f010a0..0ad53ac 100644 --- a/Dockerfile +++ b/Dockerfile.backend @@ -1,7 +1,5 @@ -# Use official Python 3.11 image as the base -FROM python:3.11 +FROM python:3.10 -# Set working directory WORKDIR /app # Install system dependencies @@ -21,6 +19,18 @@ RUN apt-get update && apt-get install -y \ RUN pip cache purge -COPY . . +# Install dependencies +COPY requirements.txt . +RUN pip install --no-cache-dir -r requirements.txt -RUN BLIS_ARCH=generic pip install --no-cache-dir -r requirements.txt \ No newline at end of file +# Copy application code +COPY app.py . +COPY sources/ ./sources/ +COPY prompts/ ./prompts/ +COPY config.ini . + +# Expose port +EXPOSE 8000 + +# Run the application +CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..5597929 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,94 @@ +version: '3.8' + +services: + redis: + container_name: redis + image: docker.io/valkey/valkey:8-alpine + command: valkey-server --save 30 1 --loglevel warning + restart: unless-stopped + volumes: + - redis-data:/data + cap_drop: + - ALL + cap_add: + - SETGID + - SETUID + - DAC_OVERRIDE + logging: + driver: "json-file" + options: + max-size: "1m" + max-file: "1" + networks: + - agentic-seek-net + + searxng: + container_name: searxng + image: docker.io/searxng/searxng:latest + restart: unless-stopped + ports: + - "8080:8080" + volumes: + - ./searxng:/etc/searxng:rw + environment: + - SEARXNG_BASE_URL=http://localhost:8080/ + - UWSGI_WORKERS=4 + - UWSGI_THREADS=4 + cap_add: + - CHOWN + - SETGID + - SETUID + logging: + driver: "json-file" + options: + max-size: "1m" + max-file: "1" + depends_on: + - redis + networks: + - agentic-seek-net + + backend: + container_name: backend + build: + context: . + dockerfile: Dockerfile.backend + ports: + - "8000:8000" + volumes: + - ./.screenshots:/app/.screenshots:ro # Mount screenshots folder + - ./app.py:/app/app.py:ro # Mount backend code + - ./sources:/app/sources:ro # Assuming sources/ contains your modules + - ./prompts:/app/prompts:ro # Assuming prompts/ for agent prompts + - ./config.ini:/app/config.ini:ro # Config file + environment: + - PYTHONUNBUFFERED=1 + depends_on: + - searxng + - redis + networks: + - agentic-seek-net + + frontend: + container_name: frontend + build: + context: ./frontend/agentic-seek + dockerfile: Dockerfile.frontend + ports: + - "3000:3000" + volumes: + - ./frontend/agentic-seek/src:/app/src # Live reload for development + environment: + - NODE_ENV=development + - CHOKIDAR_USEPOLLING=true # Ensure file watching works in Docker + depends_on: + - backend + networks: + - agentic-seek-net + +volumes: + redis-data: + +networks: + agentic-seek-net: + driver: bridge \ No newline at end of file diff --git a/frontend/agentic-seek/Dockerfile.frontend b/frontend/agentic-seek/Dockerfile.frontend new file mode 100644 index 0000000..0215ebd --- /dev/null +++ b/frontend/agentic-seek/Dockerfile.frontend @@ -0,0 +1,16 @@ +FROM node:18 + +WORKDIR /app + +# Install dependencies +COPY package.json package-lock.json ./ +RUN npm install + +# Copy application code +COPY . . + +# Expose port +EXPOSE 3000 + +# Run the application +CMD ["npm", "start"] \ No newline at end of file diff --git a/frontend/agentic-seek/src/App.js b/frontend/agentic-seek/src/App.js index 36966f1..67e266d 100644 --- a/frontend/agentic-seek/src/App.js +++ b/frontend/agentic-seek/src/App.js @@ -27,6 +27,7 @@ function App() { setError(null); try { + //const res = await axios.post('http://backend:8000/query', { ... }); const res = await axios.post('http://localhost:8000/query', { query, lang: 'en', @@ -54,11 +55,12 @@ function App() { const handleGetScreenshot = async () => { try { + //const res = await axios.get('http://backend:8000/screenshots/updated_screen.png'); const res = await axios.get('http://localhost:8000/screenshots/updated_screen.png'); setResponseData((prev) => ({ ...prev, screenshot: res.data.screenshot })); setCurrentView('screenshot'); } catch (err) { - setError('Failed to fetch screenshot.'); + setError('Browser not in use'); } }; @@ -70,7 +72,8 @@ function App() {
-

Chat

+

C H A T

+

{messages.length === 0 ? (

No messages yet. Type below to start!

@@ -110,7 +113,8 @@ function App() {
-

Details

+

I N T E R F A C E

+