Giter Site home page Giter Site logo

docker-wp-mariadb-phpmyadmin's Introduction

Docker WordPress MariaDB PHPMyAdmin

A simple docker-compose.yml for WordPress development.

This is not secure. Don't use it on a production environment

Installation

Install docker:

Install docker-compose: multi-platform documentation

Launch the stack

Create your project directory:

git clone [email protected]:loichu/docker-wp-mariadb-phpmyadmin.git your-project-name
cd your-project-name

Run docker:

docker-compose up -d
  • -d means detach, the process will be detach of the tty (terminal)

Makefile alternative

This stack contains a Makefile. It requires having make installed. This provides some useful commands.

Launch the stack:

make up

Stop the stack:

make down

Fix permissions:

make perm

See all docker logs:

make logs

See MariaDB docker logs:

make logs-db

See WordPress docker logs:

make logs-wp

Connection

Find your WordPress website at http://localhost:8080.

Find your PHPMyAdmin at http://localhost:8181.

Credentials

DB root password: secret

DB WordPress user: wordpress

DB WordPress password: wordpress

Connect to PHPMyAdmin:

  • Server: db
  • User: root
  • Password: secret

Directory structure

  • db: Persistent volume to store MariaDB database.
  • wp: Persistent volume to store WordPress files.

Issues

Unable to edit files

make perm

cannot open 'wp/wp-content/debug.log' for reading: No such file or directory

Normally in wp/wp-config.php you should have near line 80 define('WP_DEBUG', true);. Replace it by the following:

// Show debug logs in wp-content/debug.log
define('WP_DEBUG', true);
define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true );

make logs-sql shows nothing

MariaDB has to restart to load the configuration file db-conf/enable-general-logs.cnf.

make down up

WordPress asks for a FTP server

Add the following line to wp-config.php:

// Don't download through FTP
define('FS_METHOD', 'direct');

Other commands

Stop the stack:

docker-compose down

Start the stack and see logs in terminal:

docker-compose up

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.