apac-ops-bot/docker-compose.yml
SamoilenkoVadym a8151fbe66 Add comprehensive backend test suite and Phase 1 foundation
Backend Tests:
- Add pytest configuration with async support (conftest.py)
- Add model tests: User, Conversation, Message, TokenUsage, Session, UserMemory
- Add configuration tests: Settings validation and environment variables
- Add API tests: Health endpoint and future endpoint stubs
- Add database tests: Connection, transactions, query execution

Phase 1 Foundation:
- FastAPI application structure with main.py
- SQLAlchemy async models for all entities
- Alembic migrations setup
- Configuration management via Pydantic Settings
- Logging system (English only)
- Docker multi-stage builds for backend
- Docker Compose orchestration (PostgreSQL, Redis, backend)
- Frontend React + TypeScript structure
- Dark & Gold theme CSS implementation
- Environment configuration examples

All code and comments in English as per requirements.
Tests cover model relationships, cascade deletes, and constraints.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-27 14:24:59 +00:00

94 lines
2.1 KiB
YAML

version: '3.8'
services:
# PostgreSQL database
postgres:
image: postgres:15-alpine
container_name: apac_ops_bot_postgres
environment:
POSTGRES_USER: apac_ops_bot
POSTGRES_PASSWORD: secure_password
POSTGRES_DB: apac_ops_bot
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U apac_ops_bot"]
interval: 10s
timeout: 5s
retries: 5
networks:
- apac_network
restart: unless-stopped
# Redis for caching and rate limiting
redis:
image: redis:7-alpine
container_name: apac_ops_bot_redis
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- apac_network
restart: unless-stopped
# FastAPI backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
target: development
container_name: apac_ops_bot_backend
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
volumes:
- ./backend:/app
ports:
- "8000:8000"
env_file:
- ./backend/.env
environment:
- DATABASE_URL=postgresql+asyncpg://apac_ops_bot:secure_password@postgres:5432/apac_ops_bot
- REDIS_URL=redis://redis:6379/0
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- apac_network
restart: unless-stopped
# React frontend (will be configured later)
# frontend:
# build:
# context: ./frontend
# dockerfile: Dockerfile
# target: development
# container_name: apac_ops_bot_frontend
# volumes:
# - ./frontend:/app
# - /app/node_modules
# ports:
# - "3000:3000"
# env_file:
# - ./frontend/.env
# environment:
# - REACT_APP_API_URL=http://localhost:8000/api/v1
# - REACT_APP_WS_URL=ws://localhost:8000/ws
# depends_on:
# - backend
# networks:
# - apac_network
# restart: unless-stopped
volumes:
postgres_data:
networks:
apac_network:
driver: bridge