fix: resolve MariaDB collation error by switching from mysql-connector to PyMySQL
- Replace mysql-connector-python with PyMySQL driver for better MariaDB compatibility - PyMySQL handles utf8mb4_0900_ai_ci collation properly without errors - Update Dockerfile.sql-executor to install PyMySQL and psycopg2-binary - Refactor sql-query-executor.py to use PyMySQL API (pymysql.connect, DictCursor) - Verified sql-executor service with SELECT, INSERT, UPDATE operations on Freescout DB - Add n8n workflow definitions: workflow-a-http.json and workflow-b-http.json * Workflow A: Polls unprocessed conversations, analyzes with LiteLLM, saves suggestions * Workflow B: Polls approved suggestions, executes Baramundi jobs or email replies - Update compose.yaml with sql-executor service configuration and dependencies All SQL operations now execute successfully against MariaDB 11.3.2
This commit is contained in:
19
Dockerfile.sql-executor
Normal file
19
Dockerfile.sql-executor
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
RUN pip install --no-cache-dir flask PyMySQL psycopg2-binary
|
||||
|
||||
# Copy the SQL executor script
|
||||
COPY scripts/sql-query-executor.py /app/app.py
|
||||
|
||||
# Expose port
|
||||
EXPOSE 4000
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=10s --timeout=5s --retries=5 \
|
||||
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:4000/health').read()"
|
||||
|
||||
# Run the app
|
||||
CMD ["python", "app.py"]
|
||||
Reference in New Issue
Block a user