fix(deploy): wire OCR training token to backend and raise container memory limit
- Pass OCR_TRAINING_TOKEN through to the backend container as APP_OCR_TRAINING_TOKEN so RestClientOcrClient sends the X-Training-Token header when calling /train and /segtrain. - Raise mem_limit/memswap_limit from 8g to 12g to give segtrain headroom on hosts with more available RAM. - Uncomment OCR_TRAINING_TOKEN in .env.example — it is now required. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -21,9 +21,9 @@ PORT_FRONTEND=5173
|
|||||||
PORT_MAILPIT_UI=8100
|
PORT_MAILPIT_UI=8100
|
||||||
PORT_MAILPIT_SMTP=1025
|
PORT_MAILPIT_SMTP=1025
|
||||||
|
|
||||||
# OCR Training — set a secret token to protect the /train and /segtrain endpoints on the
|
# OCR Training — secret token required to call /train and /segtrain on the OCR service.
|
||||||
# Python OCR microservice. Leave empty to disable token authentication (development only).
|
# Also set in the backend so it can pass the token through. Must not be empty in production.
|
||||||
# OCR_TRAINING_TOKEN=change-me-in-production
|
OCR_TRAINING_TOKEN=change-me-in-production
|
||||||
|
|
||||||
# Production SMTP — uncomment and fill in to send real emails instead of catching them
|
# Production SMTP — uncomment and fill in to send real emails instead of catching them
|
||||||
# APP_BASE_URL=https://your-domain.example.com
|
# APP_BASE_URL=https://your-domain.example.com
|
||||||
|
|||||||
@@ -83,8 +83,8 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
expose:
|
expose:
|
||||||
- "8000"
|
- "8000"
|
||||||
mem_limit: 8g
|
mem_limit: 12g
|
||||||
memswap_limit: 8g
|
memswap_limit: 12g
|
||||||
volumes:
|
volumes:
|
||||||
- ocr_models:/app/models
|
- ocr_models:/app/models
|
||||||
- ocr_cache:/root/.cache
|
- ocr_cache:/root/.cache
|
||||||
@@ -145,6 +145,7 @@ services:
|
|||||||
SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH: ${MAIL_SMTP_AUTH:-false}
|
SPRING_MAIL_PROPERTIES_MAIL_SMTP_AUTH: ${MAIL_SMTP_AUTH:-false}
|
||||||
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE: ${MAIL_STARTTLS_ENABLE:-false}
|
SPRING_MAIL_PROPERTIES_MAIL_SMTP_STARTTLS_ENABLE: ${MAIL_STARTTLS_ENABLE:-false}
|
||||||
APP_OCR_BASE_URL: http://ocr-service:8000
|
APP_OCR_BASE_URL: http://ocr-service:8000
|
||||||
|
APP_OCR_TRAINING_TOKEN: "${OCR_TRAINING_TOKEN:-}"
|
||||||
ports:
|
ports:
|
||||||
- "${PORT_BACKEND}:8080"
|
- "${PORT_BACKEND}:8080"
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user