Sign inSign up

ntninja/wordpress-postgresql

By ntninja

•Updated over 2 years ago

WordPress, publishing platform – Including PostgreSQL database backend mod

Image
5

10K+

ntninja/wordpress-postgresql repository overview

Note: This container is automatically built by docker-image-rebuilder⁠ every night and will receive updates whenever the upstream Alpine packages or WordPress files change. (Dockerfile)⁠

WordPress as packaged by upstream⁠ with minimal changes to allow for running with the PostgreSQL database system instead of MySQL:

  • Install the PHP pgsql PostgreSQL client extension
  • Add the PostgreSQL for WordPress⁠ “plugin” files to your installation
  • Add a startup wrapper script that will ensure that the db.php hook script is placed in the right directory

Please note that is by no means an officially supported configuration and there may be issues with some plugins!

⁠How to use this image

Please see the “How to use this image⁠” section of the official WordPress container (while mentally substituting PostgreSQL for each occurance of MySQL). Note WordPress will copy the WordPress data files to the container's current working directory, defaulting to /var/www/html. When you use this container please ensure that you add data volumes for at least the wp-config and wp-content sub-directories of your working directory or data will be lost when upgrading!

⁠Troubleshooting

“PostgreSQL for WordPress” works by registering as the WordPress default database driver and then rewriting all database queries (intended for MySQL) before sending them to your PostgreSQL database. Since the SQL-dialect used by MySQL is very different from the SQL-standard-orientend dialect used by PostgreSQL this can and will cause issues at times.

If are luckey enough to hit a database-related issue with some WordPress plugin using this image you may be able to fix it using the following guide. (Basic Unix-Shell and PHP knowledge, as well as some more in-depth experience with SQL will likely be necessary.)

  1. Open your wp-content directory in a shell
  2. Use GIT to clone the latest version of “PostgreSQL for WordPress”:
    git clone https://github.com/kevinoid/postgresql-for-wordpress.git
  3. Add a symlink to the pg4wp subdirectory of that checkout:
    ln -s postgresql-for-wordpress/pg4wp
  4. Your installation should now immediately start using the “PostgreSQL for WordPress” you just downloaded
  5. Open pg4wp/driver_pgsql.php and find out which query fails and on what MySQLism it relied
  6. Fix the issue and commit the result
  7. Create a pull request at https://github.com/kevinoid/postgresql-for-wordpress/⁠

Tag summary

Content type

Image

Digest

sha256:ca6dcf73a…

Size

74.5 MB

Last updated

over 2 years ago

docker pull ntninja/wordpress-postgresql