/wordpress-pgsql

A Wordpress 6.2 Docker image with PostgreSQL support

Primary LanguagePHPOtherNOASSERTION

wordpress-pgsql

docker hub plugin source at github

A Wordpress Docker image with PostgreSQL support.

Please refer to branch v5.8 for WordPress 5.8.

On the current branch, ie. master, WordPress 6.2 runs.

Usage

You need to provide following environment variables:

  • DB_NAME - name of the PostgreSQL database to use
  • DB_USER - login for PostgreSQL
  • DB_PASSWORD - password for PostgreSQL
  • DB_HOST - host where PostgreSQL is located
  • AUTH_KEY - a random string that will be used for security purposes

The container uses port 80 to handle WordPress requests over HTTP.

As usual, after you configure your reverse proxy visit https://domainname.example.com/wp-admin/install.php to install WordPress.

To enable uploads to work, you should mount /var/www/html/wp-content/uploads as a volume.

Reverse proxy terminating SSL

If you are using a reverse proxy to terminate SSL, make sure it passes the header of X-Forwarded-Proto as https, otherwise WordPress will generate invalid links, and also be sure to set the environment variable of FORCE_SSL to 1.

Plugins surviving restarts

If you intend on installing custom plugins, you might want to declare /var/www/html/wp-content/plugins as a volume. Remember to place the necessary files there though.

Special thanks

Special thanks to Shoaib Hassan without whom this script would have taken much longer to write!

Also thanks to Kevin Locke for writing the code that enables WordPress to use PostgreSQL.

Also, many thanks to the wonderful community of WordPress!