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.
You need to provide following environment variables:
DB_NAME
- name of the PostgreSQL database to useDB_USER
- login for PostgreSQLDB_PASSWORD
- password for PostgreSQLDB_HOST
- host where PostgreSQL is locatedAUTH_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.
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
.
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 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!