Running Locally
You can run Cloud Document Maker locally on your machine using Docker. This method works on Windows, macOS, and Linux.
Prerequisites
- Docker Desktop installed and running
- Git for cloning the repository
Installation
-
Clone the repository
Terminal window git clone <repository-url>cd python-document-maker -
Setup environment variables
Terminal window cp example.env .envEdit
.envfile with your credentials (SQL Server, AWS, etc.) -
Build and run with Docker Compose
Terminal window docker-compose up --build -d -
Check that all containers are running
Terminal window docker-compose ps
Access Points
| Service | URL | Description |
|---|---|---|
| Application | http://localhost:5000 | Main Flask API |
| Documentation | http://localhost:5002 | This documentation site |
| Gotenberg | http://localhost:5001 | PDF conversion service |
Useful Docker Commands
# View logsdocker-compose logs -f
# View logs for specific servicedocker-compose logs -f app
# Stop all containersdocker-compose down
# Rebuild after code changesdocker-compose up --build -d
# Restart a specific servicedocker-compose restart appApplying Changes
When you make changes to the code or configuration, you need to restart the affected service:
| Change Made | Command |
|---|---|
| Python code (Flask app) | docker-compose restart app |
| Dockerfile | docker-compose up --build -d |
| docker-compose.yml | docker-compose up -d |
| Documentation (docs/) | docker-compose restart docs |
| Environment variables (.env) | docker-compose restart app |
Celery (Background Tasks)
Celery is the task queue used to queue “long-running” processes which can continue while the rest of the application runs as normal. For example, the webhookUrl setting uses Celery to provide a response to the client while Celery does the work of creating the document in the background and sending the file to the endpoint once it’s completed.
You can find more information on Celery here.
Cloud Document Maker uses Amazon SQS as a broker for Celery in production.
Cloud Document Maker uses SQL Server in RDS as a backend for storing task state.
Documentation Site
When running with Docker Compose, the documentation site is automatically available at http://localhost:5002.
Version Updates
When working on a new version of Cloud Document Maker, make sure to update the version number in src/version.py.