[INFRA-AI-08] Moderation Service Containerization and :11438 Network Port Allocation
Infrastructure / MLOps
NoteTask Brief
- Repository / Component:
ai_profanity_filter. - Stack: Docker, Docker Compose, Ollama (Qwen).
- Task Type: DevOps / Infra.
- Status: Ready for Implementation
Task Description
It is necessary to isolate the execution environment of the content filtering microservice into a Docker container, eliminate port conflicts within the shared AI network topology, and bind it to a dedicated port 11438.
Step-by-Step Instructions
- Locking the Network Configuration: In the
uvicorn.runserver launch parameters, configure the service to listen on port11438for incoming requests originating from the main Go backend. - Dockerfile Development: Build a minimalist image based on the official
python:3.10-slimimage. Set up the copying of the source code, theai-profanity-filterlogger settings, and dependency installations. - Registration in Docker Compose: Add the
ai-profanity-filterservice to the shared architectural orchestration file. Configure the external port mapping to11438:11438. Connect the calls to the mainollama-coreengine using network aliases. - Shared Model Volume Utilization: Since this service, like the speech text parser, utilizes the shared
qwen2.5:3bmodel, ensure that the container points to the same mounted Docker Volume where the model was initially loaded to avoid redundant disk space consumption.