Skip to content

Instantly share code, notes, and snippets.

@webdevmentor
Created July 13, 2026 19:19
Show Gist options
  • Select an option

  • Save webdevmentor/b77d394f064f1ecc7c1ebaa5d9c6cb63 to your computer and use it in GitHub Desktop.

Select an option

Save webdevmentor/b77d394f064f1ecc7c1ebaa5d9c6cb63 to your computer and use it in GitHub Desktop.
PHP Apache MariaDB Development Environment with Docker Compose

PHP + Apache + MariaDB mit Docker Compose

Starten

docker compose up -d

Webserver

http://localhost:8080

Datenbank

Host: mariadb
Database: app
User: app
Password: secret

services:
web:
build: .
ports:
- "8080:80"
volumes:
- .:/var/www/html
mariadb:
image: mariadb:10.11
environment:
MARIADB_ROOT_PASSWORD: root
MARIADB_DATABASE: app
MARIADB_USER: app
MARIADB_PASSWORD: secret
volumes:
- mariadb_data:/var/lib/mysql
volumes:
mariadb_data:
FROM php:8.5-apache
RUN docker-php-ext-install mysqli pdo pdo_mysql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment