Skip to main content

Documentation 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.

La Comanda is designed from the ground up to run with Docker Compose. A single 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’s docker-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 at http://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 $PORT environment variable (defaulting to 80), writes the correct Listen directive to Apache’s configuration, disables mpm_event and mpm_worker, enables mpm_prefork, then starts apache2-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 at localhost:3307 to avoid conflicts with a local MySQL instance
  • Persistence: Data is stored in the mysql_data named volume and survives container restarts
  • Auto-import: db/la_comanda.sql is mounted to /docker-entrypoint-initdb.d/01-init.sql and executed once on first initialisation
  • Character set: utf8 with utf8_unicode_ci collation
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

services:
  web:
    build: .
    restart: unless-stopped
    container_name: la-comanda-web
    command: ["sh", "/var/www/html/railway/start.sh"]
    ports:
      - "8080:80"
    env_file:
      - .env
    depends_on:
      - db
    volumes:
      - .:/var/www/html

  db:
    image: mysql:8.0
    container_name: la-comanda-db
    restart: unless-stopped
    env_file:
      - .env
    environment:
      MYSQL_DATABASE: ${DB_NAME}
      MYSQL_USER: ${DB_USER}
      MYSQL_PASSWORD: ${DB_PASSWORD}
      MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
      MYSQL_INITDB_SKIP_TZINFO: 1
    ports:
      - "3307:3306"
    command: --character-set-server=utf8 --collation-server=utf8_unicode_ci
    volumes:
      - mysql_data:/var/lib/mysql
      - ./db/la_comanda.sql:/docker-entrypoint-initdb.d/01-init.sql:ro

volumes:
  mysql_data:
The volume mount .:/var/www/html means any code change you make on your host takes effect immediately inside the running container — no rebuild needed.

Common Commands

# Pull images, build the web image, and start all services
docker compose up --build
Run docker compose up -d to start services in detached (background) mode, then use docker compose logs -f to follow logs whenever you need them.

Port Reference

Host portContainer portService
808080Apache (PHP application)
33073306MySQL database
Host port 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 nameMount path (container)Purpose
mysql_data/var/lib/mysqlPersists MySQL data between container restarts and re-creations
. (bind mount)/var/www/htmlLive-syncs your local source code into the web container
The 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 — ensure display_errors = Off in your php.ini or .env so 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 ports mapping from the web service and let the proxy handle TLS termination and public exposure.

Build docs developers (and LLMs) love