Skip to content
This repository has been archived by the owner on Nov 12, 2023. It is now read-only.
/ docker-wp Public archive

Dockerized WordPress with MariaDB and PHP 7.4

License

Notifications You must be signed in to change notification settings

reine/docker-wp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dockerized WordPress with MariaDB and PHP 7.4

Initial Setup

Clone this repository to use as your docker base for WordPress-enabled sites. Launch docker and create a network:

docker network create amp-wp

Update the environment variables inside secret/dev.env to suit your needs.

Start and run the containers:

docker-compose up -d

Persisting Data

To keep files down to a minimum and to prepare for a combined CI/CD (continuous integration and continuous delivery) practice, containers are removed when you stop the dockerized app. Simply meant, all your data and configurations will be lost and the next time you run the images, the database will be reinitialized.

To avoid this loss of data, volumes are mounted that will persist even after the containers were removed.

docker-wp
|- data
|- wordpress
\-docker-compose.yml

Local Access

Access the site through http://localhost/ in your browser and you should see the WordPress setup page on initial run. Proceed with the installation procedure until you have successfully logged inside the WordPress admin panel.

To access the database, use an SQL client and enter the following info:

Hostname: 127.0.0.1
Port: 8890
Username: root
Password: root123!

If you changed the default values in the secret/dev.env file, use those values instead.

Do not use the default SQL port (3306) - it will not work when accessing the database container. Use the assigned port in the docker-compose.yml file. The port number can be changed as long as you know what you are doing but for the purpose of this docker base, let's keep it as it is.

For security reasons, it is advisable to use SSH tunneling to access the database server for production use.

Custom Directives

If your site requires specific PHP directives (e.g., increased memory size), you can manage directive overrides through the provided custom.ini file.

About

Dockerized WordPress with MariaDB and PHP 7.4

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages