Skip to content

Running Locally

You can run Cloud Document Maker locally on your machine using Docker. This method works on Windows, macOS, and Linux.

Prerequisites

Installation

  1. Clone the repository

    Terminal window
    git clone <repository-url>
    cd python-document-maker
  2. Setup environment variables

    Terminal window
    cp example.env .env

    Edit .env file with your credentials (SQL Server, AWS, etc.)

  3. Build and run with Docker Compose

    Terminal window
    docker-compose up --build -d
  4. Check that all containers are running

    Terminal window
    docker-compose ps

Access Points

ServiceURLDescription
Applicationhttp://localhost:5000Main Flask API
Documentationhttp://localhost:5002This documentation site
Gotenberghttp://localhost:5001PDF conversion service

Useful Docker Commands

Terminal window
# View logs
docker-compose logs -f
# View logs for specific service
docker-compose logs -f app
# Stop all containers
docker-compose down
# Rebuild after code changes
docker-compose up --build -d
# Restart a specific service
docker-compose restart app

Applying Changes

When you make changes to the code or configuration, you need to restart the affected service:

Change MadeCommand
Python code (Flask app)docker-compose restart app
Dockerfiledocker-compose up --build -d
docker-compose.ymldocker-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.