This repository provides a Docker Compose setup for running WordPress with separate Nginx and PHP-FPM containers, optimized for deployment via Coolify.
To use this configuration, please fork this repository. Do not use it directly if you intend to make customizations to the Dockerfile, Nginx configuration, or PHP extensions.
This setup is provided as-is and should be considered experimental. While it aims to follow best practices, thorough testing in your specific environment is recommended before production use. You are free to use it in production if you deem it suitable for your needs, but do so at your own risk.
Configure the following environment variables in your Coolify application settings. Some variables have defaults or can potentially leverage Coolify's predefined variables (see link below).
WORDPRESS_DB_HOST
: Hostname/IP and port of your database service (e.g.,db-service:3306
).WORDPRESS_DB_USER
: Database username.WORDPRESS_DB_PASSWORD
: Database password (Mark as Secret).WORDPRESS_DB_NAME
: Database name.
Generate unique values from https://api.wordpress.org/secret-key/1.1/salt/
and set each one (Mark all as Secret).
WORDPRESS_AUTH_KEY
WORDPRESS_SECURE_AUTH_KEY
WORDPRESS_LOGGED_IN_KEY
WORDPRESS_NONCE_KEY
WORDPRESS_AUTH_SALT
WORDPRESS_SECURE_AUTH_SALT
WORDPRESS_LOGGED_IN_SALT
WORDPRESS_NONCE_SALT
WORDPRESS_FPM_VERSION
: Base WordPress FPM image tag (e.g.,6.5-fpm-alpine
).NGINX_VERSION
: Nginx image tag (e.g.,1.27-alpine
).
WORDPRESS_TABLE_PREFIX
: Database table prefix (defaults towp_
).WORDPRESS_DEBUG
: Set to1
to enable WP_DEBUG (defaults to0
).WORDPRESS_SITE_URL
: Public URL of your site. Can be set explicitly, or defaults to using the value of$COOLIFY_URL
if available.WORDPRESS_HOME
: Home URL, often the same asWORDPRESS_SITE_URL
. Can be set explicitly, or defaults to using the value of$COOLIFY_URL
if available.
For a full list and explanation, see the official Coolify documentation: https://coolify.io/docs/knowledge-base/environment-variables