Installation
WordPress can be installed by following the Portainer guide for creating a new stack. Learn about configuring a Docker stacks and then use the following Docker Compose code to run this app:
---
services:
db:
image: mariadb:10.6.4-focal
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- /srv/wordpress/db:/var/lib/mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=
- MYSQL_DATABASE=wordpress
- MYSQL_USER=
- MYSQL_PASSWORD=
expose:
- 3306
wordpress:
image: wordpress:latest
ports:
- 8080:80
restart: always
depends_on:
- db
volumes:
- /srv/wordpress/html:/var/www/html
environment:
- WORDPRESS_DB_HOST=db
- WORDPRESS_DB_USER=
- WORDPRESS_DB_PASSWORD=
- WORDPRESS_DB_NAME=wordpress