Git Product home page Git Product logo

docker-wp's Introduction

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.