WordPress docker-compose.yaml

networks:
  net:
    driver: bridge
    name: ${PREFIX}-net
    ipam:
      config:
        - subnet: ${SUBNET}

services:
 db:
  image: mariadb:11.6.2
  container_name: ${PREFIX}-db
  volumes:
    - ${APP_DATA}/${REPO}/wp-db:/var/lib/mysql
  ports:
    - "${EXPOSE_DB_PORT}:3306"
  labels:
    net.unraid.docker.icon: "${APP_DATA}/icons/mariadb.png"
  environment:
    - MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD
    - MYSQL_DATABASE=$MYSQL_DATABASE
    - MYSQL_USER=$MYSQL_USER
    - MYSQL_PASSWORD=$MYSQL_PASSWORD
  networks:
   - net
  restart: always

 wordpress:
  depends_on:
    - db
  image: wordpress:6.9.4
  container_name: ${PREFIX}-web
  volumes:
    - ${APP_DATA}/${REPO}/wp-html:/var/www/html
  ports:
    - "${EXPOSE_HA_PORT}:80"
  labels:
    net.unraid.docker.webui: "https://kb.remote-tech.us"
    net.unraid.docker.icon: "${APP_DATA}/icons/wordpress-96.png"
  environment:
    - WORDPRESS_DB_HOST=db
    - WORDPRESS_DB_USER=$MYSQL_USER
    - WORDPRESS_DB_PASSWORD=$MYSQL_PASSWORD
    - WORDPRESS_DB_NAME=$MYSQL_DATABASE
  networks:
   - net
  restart: on-failure

# Example .env
# -------
PREFIX=dc-wp-fe
REPO=dc-wp-frank-earnhardt
APP_DATA=/mnt/nvme-pool/appdata
SUBNET=192.168.0.0/24

EXPOSE_DB_PORT=3301
EXPOSE_HA_PORT=8000

MYSQL_ROOT_PASSWORD=xxxx
MYSQL_DATABASE=wordpress
MYSQL_USER=wpuser
MYSQL_PASSWORD=xxxx
docker compose ps
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
dc-wp-fe-db mariadb:11.6.2 "docker-entrypoint.s…" db 9 weeks ago Up 9 weeks 0.0.0.0:3001->3306/tcp, [::]:3301->3306/tcp
dc-wp-fe-web wordpress:6.9.4 "docker-entrypoint.s…" wordpress 9 hours ago Up 9 weeks 0.0.0.0:8000->80/tcp, [::]:8000->80/tcp

This website stores cookies on your computer. These cookies are used to provide a more personalized experience and to track your whereabouts around our website in compliance with the European General Data Protection Regulation. If you decide to to opt-out of any future tracking, a cookie will be setup in your browser to remember this choice for one year.

Accept or Deny