La Comanda is designed from the ground up to run with Docker Compose. A singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/JAQA20/LaComanda/llms.txt
Use this file to discover all available pages before exploring further.
docker compose up --build starts both the PHP/Apache application and a MySQL 8.0 database, mounts your local source code directly into the container, and seeds the database automatically — no manual setup required.
Services
La Comanda’sdocker-compose.yml defines two services that work together:
web — PHP/Apache Application
Built from the project’s Dockerfile (based on php:8.2-apache-bookworm) with the mysqli, pdo_mysql, mbstring, and curl extensions installed and Apache mod_rewrite enabled. Key details:
- Container name:
la-comanda-web - Port mapping:
8080:80— the app is available athttp://localhost:8080 - Volume mount:
.:/var/www/html— your local project files are mounted directly into the container - Entrypoint:
railway/start.sh— this script reads the$PORTenvironment variable (defaulting to80), writes the correctListendirective to Apache’s configuration, disablesmpm_eventandmpm_worker, enablesmpm_prefork, then startsapache2-foreground
db — MySQL 8.0 Database
Runs the official mysql:8.0 image with persistent storage and automatic schema seeding on first start:
- Container name:
la-comanda-db - Port mapping:
3307:3306— connect from your host atlocalhost:3307to avoid conflicts with a local MySQL instance - Persistence: Data is stored in the
mysql_datanamed volume and survives container restarts - Auto-import:
db/la_comanda.sqlis mounted to/docker-entrypoint-initdb.d/01-init.sqland executed once on first initialisation - Character set:
utf8withutf8_unicode_cicollation
The first
docker compose up --build may take several minutes to pull images
and seed the database. Subsequent starts are significantly faster.Complete docker-compose.yml
Common Commands
Port Reference
| Host port | Container port | Service |
|---|---|---|
8080 | 80 | Apache (PHP application) |
3307 | 3306 | MySQL database |
3307 is used instead of the default 3306 so it does not conflict with a MySQL server that may already be running on your development machine.
Volume Reference
| Volume name | Mount path (container) | Purpose |
|---|---|---|
mysql_data | /var/lib/mysql | Persists MySQL data between container restarts and re-creations |
. (bind mount) | /var/www/html | Live-syncs your local source code into the web container |
mysql_data named volume is managed by Docker. It survives docker compose down but is removed when you run docker compose down -v, which gives you a clean way to fully reset the database.
Production Considerations
Docker Compose is well-suited for local development and simple self-hosted deployments. Before running in a production environment, review the following:- Rotate all passwords — replace every credential in
.env(database passwords, any application secrets) with strong, randomly-generated values before exposing the service publicly. - Set
APP_ENV=production— this enables production-appropriate error handling and caching behaviour throughout the application. - Use a managed database — consider replacing the containerised MySQL service with a managed provider (e.g. PlanetScale, AWS RDS, or Railway MySQL) to benefit from automated backups, high availability, and easier scaling.
- Disable PHP
display_errors— ensuredisplay_errors = Offin yourphp.inior.envso stack traces and internal errors are never exposed to end users. - Review exposed ports — in a production deployment behind a reverse proxy (nginx, Caddy, Traefik), remove the
portsmapping from thewebservice and let the proxy handle TLS termination and public exposure.