This guide will help you run the Espresso service using Docker Compose.
- Docker and Docker Compose
- Make (optional)
-
All required files are already provided in the repository:
- HTML templates in
service/inputfiles/templates/
- Sample PDFs in
service/inputfiles/inputPDFs/
- Test certificates in
service/inputfiles/certificates/
- Configuration in
configs/espressoconfig.yaml
- HTML templates in
-
Build and start all containers using make
make
or directly run docker compose from root
DOCKERFILE=service/Dockerfile \
docker-compose -f service/docker-compose.yml build && \
docker-compose -f service/docker-compose.yml up -d
then open http://localhost:3000 on a browser to access the espresso console
This will:
- Build all Docker containers
- Start MySQL for template storage
- Initialize LocalStack for S3 storage
- Launch the PDF service
- Start the web UI
- Open http://localhost:3000 in your browser
-
Template Management:
- Go to http://localhost:3000/templates
- Click "Create New Template"
- Fill in:
- Template Name
- HTML Content
- JSON Schema (for form fields, placeholders, images, etc)
- Click "Save Template"
-
Generate PDF:
- Go to http://localhost:3000/generate
- Select a template
- Input your JSON data
- Click "Generate PDF"
- Download or view the generated PDF
-
Sign PDF:
- Go to http://localhost:3000/sign
- Generate a PDF
- Click "Generate signed PDF"
- Download the signed PDF
-
Certificate Issues:
- Verify certificate files exist in the specified path
- Check certificate password in config
- Ensure certificate format is correct (X.509 for cert, PKCS#8 for key)
-
Storage Issues:
- For disk storage: Check file permissions
- For S3: Verify LocalStack is running (
docker ps
) - For MySQL: Check connection string in config
-
Template Issues:
- Verify HTML is valid
- Check JSON schema matches your data
- Templates must be accessible from configured storage
-
Common Errors:
- "Template not found": Check storage configuration
- "Certificate load failed": Verify certificate paths and passwords
- "PDF generation failed": Check HTML template validity
- "Storage error": Verify storage configuration and permissions
- Check the API documentation for more endpoints
- Review the Integration Guide for programmatic usage
- Explore advanced features like custom headers/footers
- Configure production settings for deployment
For more detailed information, refer to the Integration Guide.