ci: full docker compose deploy

This commit is contained in:
martin legrand 2025-04-14 21:51:46 +02:00
parent c65e6321f5
commit 89c3ecea68
5 changed files with 136 additions and 8 deletions

View File

@ -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
# 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"]

94
docker-compose.yml Normal file
View File

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

View File

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

View File

@ -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() {
<main className="main">
<div className="chat-container">
<div className="left-panel">
<h2>Chat</h2>
<h2>C H A T</h2>
<br></br>
<div className="messages">
{messages.length === 0 ? (
<p className="placeholder">No messages yet. Type below to start!</p>
@ -110,7 +113,8 @@ function App() {
</form>
</div>
<div className="right-panel">
<h2>Details</h2>
<h2>I N T E R F A C E</h2>
<br></br>
<div className="view-selector">
<button
className={currentView === 'blocks' ? 'active' : ''}

View File

@ -1,3 +1,7 @@
fastapi==0.115.12
uvicorn==0.34.0
pydantic==2.10.6
pydantic_core==2.27.2
setuptools>=75.6.0
requests>=2.31.0
numpy>=1.24.4