proomt

Search

Search posts, papers, and topics

All posts

CodeshipKelly Andrews10 min readtutorialintro

Using Docker Compose for PHP Development

Summary

This tutorial demonstrates how to set up a PHP/Laravel/PostgreSQL development environment using Docker and Docker Compose. It covers creating a Dockerfile for the PHP application and defining services for NGINX, the PHP app, and PostgreSQL in a docker-compose.yml file.

  • A Dockerfile defines the application image, including PHP, extensions, Composer, and application code.
  • Docker Compose orchestrates multiple services like NGINX, PHP-FPM, and PostgreSQL for a complete dev environment.
  • Volumes in docker-compose.yml can sync local code into containers and persist data.
  • Environment variables are used to configure connections, such as the DATABASE_URL for the PHP application.

This guide is useful for engineers looking to containerize their PHP development workflow, ensuring consistent environments and simplifying onboarding.

6/10

Related reading

  1. Using Docker Compose for NodeJS Development

    This tutorial demonstrates how to set up a Node.js application with a PostgreSQL database using Docker Compose for local development. It covers creating a Dockerfile for the Node.js app and defining both services in a docker-compose.yml file, including volume mounts and environment variables.

    Codeshipcloudbees.com9 min
  2. Laravel Vet: Review Composer Code Before It Installs

    Laravel Vet is a Composer plugin that intercepts installs/updates, shows the diff of each package, and lets you approve changes manually or via an LLM‑based coding agent. Trusted packages are recorded in a `vet.json` with a content hash, so future updates only prompt for new changes. The tool exits with an error on untrusted code, making it CI‑friendly, and works with any PHP project using Compos…

    Laravellaravel-news.com4 min