feat: environment hardening, Docker optimization (16GB → 2.9GB), export fixes & Cloud Run deployment guide#425
Open
sairamanuja wants to merge 1 commit intopresenton:mainfrom
Conversation
This was referenced Mar 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses several production and deployment issues that have been open for a while — Docker image bloat, broken exports, unconfigurable Gemini image generation, and missing deployment documentation. All changes are backward-compatible.
Closes #396, #402
Relates to #366, #416
What's in this PR
Docker image optimization — 16 GB → 2.9 GB
The original image was impractical to distribute. Root causes were no multi-stage build, full PyTorch installation with test suites and debug symbols, and Docling resources baked into the final layer.
Changes:
python:3.11-slim-bookwormandnode:20-slimbase imagestorch/test,torch/include,torch/share(~97% reduction)aptoperations into a single layer with cleanupFull write-up in
DOCKER_OPTIMIZATION_GUIDE.md.Environment configuration hardening
Hardcoded values in
docker-compose.yml,docker-compose-separate.yml, andget_env.pymade it impossible to customize deployments without editing source files.Changes:
get_gemini_flash_model_env()inget_env.py${VAR:-default})GEMINI_FLASH_MODEL,IMAGE_PROVIDER,PIXABAY_API_KEY./container.db→./app_data/presenton.db.env.examplewith all variables documented by categoryGemini image generation fix (#402)
GEMINI_FLASH_MODELwas hardcoded inget_env.py, making it impossible to configure without modifying source. This is now fully environment-driven:PPT / PDF export fixes (#366, #416)
Cloud Run deployment guide
Added a complete end-to-end guide for deploying to Google Cloud Run, including Artifact Registry setup, GCS bucket persistence, Cloud SQL configuration, service-to-service communication, and a production checklist.
See
CLOUD_RUN_DEPLOYMENT_GUIDE.md.Testing
Backward compatibility
No breaking changes. Existing
.envfiles, Docker Compose usage, and API contracts are unchanged. All defaults are preserved.Happy to split into smaller PRs if that's easier to review.