Documentation Index
Fetch the complete documentation index at: https://mintlify.com/joaquinobed/simple-invoice/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Simple Invoice includes a Dockerfile that packages the application with PHP 5.6.29 on a Debian-based image. This guide covers building and running the application in a containerized environment.Prerequisites
- Docker installed on your system
- Docker Machine (optional, for non-Linux systems)
- Database server (MySQL/MariaDB)
Dockerfile Configuration
The application uses the following base configuration:Installed Components
- Base Image: Debian Jessie (minideb-buildpack)
- PHP Version: 5.6.29
- Runtime: Bitnami PHP stack
Building the Docker Image
Build the image
php-simple-invoice using the Dockerfile in the project root.Running the Container
Basic Run Command
Production Configuration
For a production deployment, you’ll need to:Environment Variables
Configure the following environment variables for your deployment:| Variable | Default | Description |
|---|---|---|
DB_HOST | localhost | Database host (use container name in Docker network) |
DB_USER | root | Database username |
DB_PASS | (empty) | Database password |
DB_NAME | simple_invoice | Database name |
Volume Mounts
Persistent Data
Mount the following directories to persist data across container restarts:/app/img- Stores uploaded company logos (max 1MB per image)/app/pdf/documentos- Stores generated invoice PDFs/app/config- Configuration files (database credentials)
Logo uploads are limited to JPG, JPEG, PNG, and GIF formats with a maximum size of 1MB. See
ajax/imagen_ajax.php:19 for upload validation logic.Docker Compose
Create adocker-compose.yml file for easier management:
Using Docker Compose
Database Initialization
Import the database schema on first run:Connecting to the Container
Finding the Container IP
If using Docker Machine:Accessing the Application
Connect to the container at:DOCKER_IP with your Docker host IP address.
Health Checks
Add health checks to your Docker configuration:Troubleshooting
Container Won’t Start
Check the logs:Database Connection Failed
Verify the database container is running and accessible:Permission Issues
Ensure the web server has write permissions:Next Steps
- Configure database credentials in
config/db.php - Set up SSL/HTTPS with a reverse proxy
- Review Production Deployment for security best practices
- Configure automated backups for volumes
