ba6e7669e8
Features: - FastAPI + SQLAlchemy 2.0 async + PostgreSQL/pgvector + Redis backend - Vue 3 + TypeScript + Element Plus frontend - JWT auth with access/refresh tokens and revocation - Admin/member RBAC - RSS feed CRUD and article listing - Settings management with Fernet encryption for sensitive values - Redis distributed lock service - Alembic initial migration - Docker Compose development environment Fixes from code review: - Fix DB session leak in dependency injection - Restrict registration to admin only - Add default admin password warning - Implement JWT refresh tokens and jti blacklist - Strengthen password policy - Use func.count for pagination totals - Replace NullPool with AsyncAdaptedQueuePool - Remove init_db from lifespan to enforce alembic migrations - Add request_id middleware and logging filter - Fix vite.config.ts env loading - Add frontend token refresh interceptor - Add Vue error handler Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
101 lines
2.6 KiB
YAML
101 lines
2.6 KiB
YAML
services:
|
|
postgres:
|
|
image: ankane/pgvector:latest
|
|
container_name: rss-platform-postgres
|
|
environment:
|
|
POSTGRES_USER: rss
|
|
POSTGRES_PASSWORD: rss
|
|
POSTGRES_DB: rss_platform
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
- ./docker/init-scripts:/docker-entrypoint-initdb.d:ro
|
|
ports:
|
|
- "${POSTGRES_PORT:-5432}:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U rss -d rss_platform"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: rss-platform-redis
|
|
volumes:
|
|
- redis_data:/data
|
|
ports:
|
|
- "${REDIS_PORT:-6379}:6379"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
minio:
|
|
image: minio/minio:latest
|
|
container_name: rss-platform-minio
|
|
command: server /data --console-address ":9001"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ACCESS_KEY:-minioadmin}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_SECRET_KEY:-minioadmin}
|
|
volumes:
|
|
- minio_data:/data
|
|
ports:
|
|
- "${MINIO_API_PORT:-9000}:9000"
|
|
- "${MINIO_CONSOLE_PORT:-9001}:9001"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: docker/backend.Dockerfile
|
|
target: development
|
|
container_name: rss-platform-backend
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- DATABASE_URL=${DATABASE_URL:-postgresql+asyncpg://rss:rss@postgres:5432/rss_platform}
|
|
- REDIS_URL=${REDIS_URL:-redis://redis:6379/0}
|
|
volumes:
|
|
- ./backend:/app:cached
|
|
- platform_data:/app/data
|
|
ports:
|
|
- "${BACKEND_PORT:-8000}:8000"
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
command: uvicorn main:app --host 0.0.0.0 --port 8000 --reload --log-level ${LOG_LEVEL:-info}
|
|
healthcheck:
|
|
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: ../docker/frontend.Dockerfile
|
|
container_name: rss-platform-frontend
|
|
volumes:
|
|
- ./frontend:/app:cached
|
|
- /app/node_modules
|
|
ports:
|
|
- "${FRONTEND_PORT:-5173}:5173"
|
|
environment:
|
|
- VITE_API_BASE_URL=http://localhost:${BACKEND_PORT:-8000}/api/v1
|
|
command: npm run dev -- --host
|
|
depends_on:
|
|
- backend
|
|
|
|
volumes:
|
|
postgres_data:
|
|
redis_data:
|
|
minio_data:
|
|
platform_data:
|