77 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			77 lines
		
	
	
		
			2.2 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
# 2025-10-17 Hyperling
 | 
						|
# Copied and modified from the example here:
 | 
						|
#   https://hub.docker.com/_/wordpress
 | 
						|
# This file needs copied to `docker-compose.yml`.
 | 
						|
# Most configration changes can be done in the env file rather than here.
 | 
						|
 | 
						|
## TBDs ##
 | 
						|
# - Move env variables to env.example
 | 
						|
# - Look through other environment variables which may be useful.
 | 
						|
# - Add CPU and MEM section
 | 
						|
# - Change ports
 | 
						|
 | 
						|
# TBD locate these at ../../Volumes and create `prep.sh` script.
 | 
						|
#volumes:
 | 
						|
#  wordpress:
 | 
						|
#  db:
 | 
						|
 | 
						|
services:
 | 
						|
 | 
						|
  app:
 | 
						|
    container_name: wp-app
 | 
						|
    image: wordpress:latest
 | 
						|
    restart: always
 | 
						|
    ports:
 | 
						|
      - 8080:80
 | 
						|
    depends_on:
 | 
						|
      db:
 | 
						|
        condition: service_healthy
 | 
						|
    links:
 | 
						|
      - db
 | 
						|
    volumes:
 | 
						|
      - ../../Volumes/WordPress/wordpress:/var/www/html
 | 
						|
    environment:
 | 
						|
      WORDPRESS_ADMIN_USERNAME: $WORDPRESS_ADMIN_USERNAME
 | 
						|
      WORDPRESS_ADMIN_PASSWORD: $WORDPRESS_ADMIN_PASSWORD
 | 
						|
      WORDPRESS_DB_HOST: wp-db
 | 
						|
      WORDPRESS_DB_NAME: $MARIADB_DATABASE
 | 
						|
      # TBD/TODO: Does not work, but recommended. :(
 | 
						|
      #WORDPRESS_DB_USER: $MARIADB_USER
 | 
						|
      #WORDPRESS_DB_PASSWORD: $MARIADB_PASSWORD
 | 
						|
      # Works, but not recommended. Lol.
 | 
						|
      WORDPRESS_DB_USER: root
 | 
						|
      WORDPRESS_DB_PASSWORD: $MARIADB_ROOT_PASSWORD
 | 
						|
      WORDPRESS_DEBUG: $WORDPRESS_DEBUG
 | 
						|
    deploy:
 | 
						|
      mode: global
 | 
						|
      resources:
 | 
						|
        limits:
 | 
						|
          cpus: $WP_CPU
 | 
						|
          memory: $WP_MEM
 | 
						|
 | 
						|
  db:
 | 
						|
    container_name: wp-db
 | 
						|
    image: mariadb:lts
 | 
						|
    restart: always
 | 
						|
    volumes:
 | 
						|
      - ../../Volumes/WordPress/mariadb:/var/lib/mysql
 | 
						|
    healthcheck:
 | 
						|
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
 | 
						|
      start_period: 5s
 | 
						|
      interval: 5s
 | 
						|
      timeout: 5s
 | 
						|
      retries: 10
 | 
						|
    environment:
 | 
						|
      # https://mariadb.com/docs/server/server-management/automated-mariadb-deployment-and-administration/docker-and-mariadb/mariadb-server-docker-official-image-environment-variables
 | 
						|
      MARIADB_DATABASE: $MARIADB_DATABASE
 | 
						|
      MARIADB_USER: $MARIADB_USER
 | 
						|
      MARIADB_PASSWORD: MARIADB_PASSWORD
 | 
						|
      MARIADB_ROOT_PASSWORD: $MARIADB_ROOT_PASSWORD
 | 
						|
      MARIADB_AUTO_UPGRADE: $MARIADB_AUTO_UPGRADE
 | 
						|
    deploy:
 | 
						|
      mode: global
 | 
						|
      resources:
 | 
						|
        limits:
 | 
						|
          cpus: $WP_CPU_DB
 | 
						|
          memory: $WP_MEM_DB
 |