# to override the environment, you can configure environment variables in a .env file saved in this directory. # the following environment variables are supported: # - PHP_VERSION - defaults to 8.1, must be a version that has an official docker container available # - BACKEND - 'mariadb' or 'mysql', defaults to 'mariadb' # - WORDPRESS_VERSION - defaults to latest (defined below) # - PORT - the port to expose wordpress on, defaults to 3000 # - WP_ADMIN_USER - the admin wordpress username, defaults to 'root' # - WP_ADMIN_EMAIL - the admin user's email, defaults to 'nobody@nowhere.local' # - WOOCOMMERCE - if set, installs and sets up woocommerce # - MULTISITE - if set to '1', creates a multisite wordpress install. the folder will be suffixed with '-multi' services: # basic apache service wordpress: env_file: - .env.default - .env - ${CUSTOM_ENV_FILE:-/dev/null} build: context: ./scripts dockerfile: ./Dockerfile.local args: BASE_IMAGE: "${BASE_IMAGE:-php:$PHP_VERSION-apache}" environment: RUN_AS_USER: "${UID:-1000}" volumes: - ./docker/wordpress:$DOCUMENT_ROOT - .:$DOCUMENT_ROOT/matomo-for-wordpress - ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh - ./docker/wp-cli:/.wp-cli - ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini - ./scripts/local-gitconfig:/root/.gitconfig ports: - "$PORT:$PORT" entrypoint: /usr/src/entrypoint.sh depends_on: - $BACKEND - mailer extra_hosts: - "host.docker.internal:host-gateway" # nginx service fpm: env_file: - .env.default - .env - ${CUSTOM_ENV_FILE:-/dev/null} build: context: . dockerfile: ./scripts/Dockerfile.local args: BASE_IMAGE: "${BASE_IMAGE:-php:$PHP_VERSION-fpm}" volumes: - ./docker/wordpress:$DOCUMENT_ROOT - .:$DOCUMENT_ROOT/matomo-for-wordpress - ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh - ./docker/wp-cli:/.wp-cli - ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini - ./scripts/local-gitconfig:/.gitconfig entrypoint: /usr/src/entrypoint.sh depends_on: - "$BACKEND" nginx: image: nginx volumes: - ./scripts/local-dev-nginx.conf:/etc/nginx/conf.d/default.conf - ./docker/wordpress:$DOCUMENT_ROOT - .:$DOCUMENT_ROOT/matomo-for-wordpress depends_on: - fpm ports: - "$PORT:80" deploy: restart_policy: condition: on-failure # litespeed enterprise (requires license) litespeed: env_file: - .env.default - .env - ${CUSTOM_ENV_FILE:-/dev/null} build: context: ./scripts dockerfile: ./Dockerfile.local args: BASE_IMAGE: litespeedtech/litespeed:6.3.2-lsphp81 ulimits: nofile: soft: 50000 hard: 50000 nproc: 65535 deploy: resources: limits: memory: 1G environment: RUN_AS_USER: "${UID:-1000}" DOCUMENT_ROOT: /var/www/vhosts/localhost/html volumes: - ./docker/wordpress:/var/www/vhosts/localhost/html - .:/var/www/vhosts/localhost/html/matomo-for-wordpress - ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh - ./docker/wp-cli:/.wp-cli - ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini - ./scripts/local-gitconfig:/root/.gitconfig - ./serial.no:/serial.no ports: - "$PORT:$PORT" entrypoint: /usr/src/entrypoint.sh depends_on: - $BACKEND - mailer extra_hosts: - "host.docker.internal:host-gateway" # service for running CLI utilities including wp-cli, the matomo console and phpunit exec: env_file: - .env.default - .env - ${CUSTOM_ENV_FILE:-/dev/null} build: context: ./scripts dockerfile: ./Dockerfile.local args: BASE_IMAGE: "${BASE_IMAGE:-php:$PHP_VERSION-apache}" volumes: - ./docker/wordpress:$DOCUMENT_ROOT - .:$DOCUMENT_ROOT/matomo-for-wordpress - ./docker/wp-cli:/.wp-cli - ./scripts/local-php-custom.ini:/usr/local/etc/php/conf.d/php-custom.ini - ./scripts/local-dev-entrypoint.sh:/usr/src/entrypoint.sh - ./scripts/local-gitconfig:/.gitconfig ports: - "$PORT:80" user: "${UID:-1000}:${GID:-1000}" entrypoint: /usr/src/entrypoint.sh environment: EXECUTE_CLI: 1 MULTISITE: ${MULTISITE:-0} WP_MULTISITE: ${WP_MULTISITE:-0} depends_on: - "$BACKEND" extra_hosts: - "host.docker.internal:host-gateway" # database service definitions mariadb: image: mariadb:lts environment: MYSQL_ROOT_PASSWORD: pass volumes: - ./docker/mariadb:/var/lib/mysql:delegated - ./docker/maria_custom_my.cnf:/etc/mysql/conf.d/mycustom.cnf deploy: restart_policy: condition: on-failure mysql: image: mysql environment: MYSQL_ROOT_PASSWORD: pass volumes: - ./docker/mysql:/var/lib/mysql:delegated - ./docker/container-files/mysql_custom_my.cnf:/etc/mysql/conf.d/mycustom.cnf ports: - "3307:3306" deploy: restart_policy: condition: on-failure mailer: image: axllent/mailpit deploy: restart_policy: condition: on-failure volumes: - ./docker/mailer:/data ports: - 8025:8025 environment: MP_SMTP_AUTH_ACCEPT_ANY: 1 MP_SMTP_AUTH_ALLOW_INSECURE: 1