Skip to main content

Services

File: docker-compose.yaml All services on the tb.network Docker network.

Database defaults

Primary:
Test:

Dockerfile

File: Dockerfile Multi-stage build:

Stage 1: Nginx

Stage 2: App (PHP-FPM)

System dependencies installed:
  • libxml2, bash, sudo
  • freetype, libjpeg, libpng (image processing)
  • libzip, curl, imap, xslt
  • PostgreSQL libs, libgcrypt, oniguruma
PHP extensions:
  • gd (with freetype/jpeg/png support)
  • bcmath, ctype, json
  • pdo, pdo_mysql, mysqli
  • tokenizer, xml
Additional tools:
  • Dockerize v0.6.1 (wait-for-service utility)
  • Composer (dependency installation)

Container startup

The entrypoint runs:
Migrations run on every container start. If a migration fails, the container fails to start. Be careful with migration changes in production.

Permissions

The Dockerfile sets www-data:www-data ownership on:
  • bootstrap/
  • storage/
  • public/

Nginx configuration

File: app-nginx.conf
Key settings:
  • Max upload size: 100MB
  • PHP handling: FastCGI pass to app:9000
  • Gzip: Static gzip enabled
  • All routes fall through to index.php (Laravel routing)

Volumes

Docker Compose mounts:
  • Source code → /src
  • vendor/ → named volume (persists between rebuilds)
  • storage/ → named volume
  • bootstrap/ → named volume
  • public/ → shared between app and nginx
Database volumes:
  • ./data → MySQL primary data
  • ./data_test → MySQL test data
data/ and data_test/ directories are gitignored. They persist database state between Docker restarts.

Common commands