How to create a Wordpress instance using docker-compose.

  • 05 Sep, 2017

Docker containers are like magic.  You can create a wodpress instance in minutes.

Today i create a docker-compose.yml file for a Wordpress inance.

Just create the file with the commands bellow and you will get a Wordpress site.  You will not loose the customizations because they are saved on the host machine.

Create the folders /wp-content and wp-content/uploads  bellow the folder that contains docker-compose.yml. I test this instance only on my Mac for development.

version: ‘3’

services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PASSWORD: rootpassword MYSQL_DATABASE: wordpress MYSQL_USER: wordpress MYSQL_PASSWORD: yourpassword

wordpress: depends_on: - db image: wordpress:latest volumes: - ./wp-content/uploads:/var/www/html/wp-content/uploads - ./wp-content:/var/www/html/wp-content ports: - “8000:80” restart: always environment: WORDPRESS_DB_HOST: db:3306 WORDPRESS_DB_USER: wordpress WORDPRESS_DB_PASSWORD: yourpassword volumes: db_data:

Related Posts

How to Use Podman with the GitHub MCP Server: Fixing the ENOENT Error on IBM Bob

  • 17 Jun, 2026

If you are exploring the new world of the Model Context Protocol (MCP) and trying to install the GitHub MCP server on IBM Bob, there is a good chance the documentation pointed you toward Docker. But w

How to Use Podman with the GitHub MCP Server: Fixing the ENOENT Error on IBM BobRead More

Docker grace period ends on January 31

  • 26 Jan, 2022

I received an email yesterday from Docker. It's a reminder about the end of grace period. Hello, As a reminder you’re receiving this email because on August 31, 2021 we updated the terms(https://ema

Docker grace period ends on January 31Read More

A rootless Pod for wordpress

  • 07 Dec, 2021

Podman Pods are very similar to Kubernetes pods in a way that they can have more than one container. Every Podman pod contains one infra container by default. This container is responsible for associ

A rootless Pod for wordpressRead More