installing wordpress on ubuntu (WordPress on Docker with remote NGINXProxyManager)
WordPress on Docker with remote NGINXProxyManager
To install WordPress on Docker, you can use Docker Compose to simplify the process. Below are the steps and the Docker Compose file needed to set up WordPress with a MySQL database.
Steps to Install WordPress on Docker
Install Docker and Docker Compose: If you haven't already, install Docker and Docker Compose on your system.
Create a Directory for Your Project: This directory will contain your Docker Compose file and other necessary files.
mkdir wordpress
cd wordpress
Create a Docker Compose File: In the directory you created, create a file named docker-compose.yml
and add the following content:
services:
db:
image: mysql:8.0
restart: unless-stopped
env_file: .env
environment:
MYSQL_DATABASE: awesomewp
MYSQL_USER: wp_user
MYSQL_PASSWORD: password
MYSQL_ROOT_PASSWORD: somepassword
volumes:
- ./db:/var/lib/mysql
wordpress:
depends_on:
- db
ports:
- "5001:80"
image: wordpress
restart: unless-stopped
env_file: .env
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wp_user
WORDPRESS_DB_PASSWORD: password
WORDPRESS_DB_NAME: awesomewp
volumes:
- ./website:/var/www/html
run below command to execute it
docker compose up -d
Then after check if it able to access from ipaddr:5001
then configure it in nginxproxymanager by providing dmain name and all
Last updated