{"id":18250,"date":"2023-07-08T23:36:43","date_gmt":"2023-07-08T20:36:43","guid":{"rendered":"https:\/\/kifarunix.com\/?p=18250"},"modified":"2024-03-10T10:27:17","modified_gmt":"2024-03-10T07:27:17","slug":"deploy-wordpress-using-docker-compose","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/deploy-wordpress-using-docker-compose\/","title":{"rendered":"Deploy WordPress using Docker Compose"},"content":{"rendered":"\n<p>In this tutorial, you will learn how to deploy WordPress using Docker compose. In an ever-evolving digital landscape, where websites serve as essential touch-points for businesses and individuals, ensuring a seamless and secure online presence has become paramount. Enter <a href=\"https:\/\/www.docker.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Docker<\/a> and Docker Compose \u2013 two powerful tools that have revolutionized the way applications are packaged, shipped, and managed. If you&#8217;re seeking a streamlined solution to deploy WordPress with all its dependencies, look no further!<\/p>\n\n\n\n<div class=\"wp-block-rank-math-toc-block\" id=\"rank-math-toc\"><h2>Table of Contents<\/h2><nav><ul><li><a href=\"#deploying-word-press-using-docker-compose\">Deploying WordPress using Docker Compose<\/a><ul><li><a href=\"#word-press-and-docker-compose\">WordPress and Docker compose<\/a><\/li><li><a href=\"#install-docker-engine\">Install Docker Engine<\/a><\/li><li><a href=\"#install-docker-compose\">Install Docker Compose<\/a><\/li><li><a href=\"#create-project-directory\">Create Project Directory<\/a><\/li><li><a href=\"#define-word-press-application-services\">Define WordPress Application Services<\/a><\/li><li><a href=\"#deploy-word-press-app-using-docker-compose\">Deploy WordPress App using Docker Compose<\/a><\/li><li><a href=\"#word-press-container-extra-configurations\">WordPress Container Extra Configurations<\/a><\/li><li><a href=\"#run-word-press-container-with-nginx\">Run WordPress Container with Nginx<\/a><\/li><li><a href=\"#run-word-press-container-with-ssl-tls\">Run WordPress Container with SSL\/TLS<\/a><ul><li><a href=\"#configure-ssl-tls-with-the-default-apache-web-server\">Configure SSL\/TLS with the default Apache Web Server<\/a><\/li><li><a href=\"#configure-ssl-tls-with-nginx-web-server\">Configure SSL\/TLS with Nginx Web Server<\/a><\/li><\/ul><\/li><li><a href=\"#conclusion\">Conclusion<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"deploying-word-press-using-docker-compose\">Deploying WordPress using Docker Compose<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"word-press-and-docker-compose\">WordPress and Docker compose<\/h3>\n\n\n\n<p>Well, as much as you can decouple each component (Database, Web Server (<strong><em>Apache by default<\/em><\/strong>), PHP) of a WordPress application and run each one of them as a separate container, it is much easier to deploy WordPress and its dependencies using Docker compose in as single file.<\/p>\n\n\n\n<p>Docker Compose is a tool used to define and run multi-container applications using a simple configuration file in YAML format. Within the YAML configuration file, you can define the services, networks, and volumes required for your application. This makes it easy to manage complex application setups locally.<\/p>\n\n\n\n<p>If you are running a Docker swarm in your environment setup, then you can deploy them as a Docker stack.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-docker-engine\">Install Docker Engine<\/h3>\n\n\n\n<p>You need Docker Engine for running and managing your Docker containers.<\/p>\n\n\n\n<p>Thus, depending on the Linux distribution you are using, check our guides on how to install Docker;<\/p>\n\n\n\n<p><a href=\"https:\/\/kifarunix.com\/?s=install+docker\" target=\"_blank\" rel=\"noreferrer noopener\">How to install Docker engine on Linux<\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"install-docker-compose\">Install Docker Compose<\/h3>\n\n\n\n<p>You need Docker compose to manage multiple containers that work together as a single application.<\/p>\n\n\n\n<p>Note that when you install Docker engine, it should also install the docker compose which you can use by typing;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker compose --help<\/code><\/pre>\n\n\n\n<p>On any Linux distro, the commands below should be able to get standalone Docker compose (<strong><code>docker-compose<\/code><\/strong>) installed.<\/p>\n\n\n\n<p>(Check the current release version number <a href=\"https:\/\/github.com\/docker\/compose\/releases\" target=\"_blank\" rel=\"noreferrer noopener\">releases page<\/a> and replace the versions accordingly in the command below.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -SL \\\nhttps:\/\/github.com\/docker\/compose\/releases\/download\/v2.20.2\/docker-compose-linux-x86_64 \\\n-o \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p>Make it executable;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x \/usr\/local\/bin\/docker-compose<\/code><\/pre>\n\n\n\n<p>You can use it now by running <code>docker-compose<\/code>;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose version<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"create-project-directory\">Create Project Directory<\/h3>\n\n\n\n<p>While it is optional, I find it easier to manage your application within custom directory. In this guide, I used a WordPress application directory, <code>\/opt\/wordpress<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir \/opt\/wordpress<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"define-word-press-application-services\">Define WordPress Application Services<\/h3>\n\n\n\n<p>Next, create a docker-compose YAML\/YML file with service definitions of your WordPress app.<\/p>\n\n\n\n<p>In the most basic setup, you would only need a WordPress and database services in the compose file. WordPress Docker image usually comes bundled with a web server, PHP and commonly required PHP modules.<\/p>\n\n\n\n<p>So, let&#8217;s create a <strong><code>docker-compose<\/code><\/strong> YAML\/YML file for our WordPress app. Docker-compose command will interpret either of the file extension.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>cd \/opt\/wordpress<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>vim docker-compose.yaml<\/code><\/pre>\n\n\n\n<p>This is our WordPress app definition;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\nversion: '3'\n\nservices:\n\n  wordpress:\n    image: wordpress\n    container_name: wordpress\n    restart: unless-stopped\n    ports:\n      - 8080:80\n    environment:\n      WORDPRESS_DB_HOST: db\n      WORDPRESS_DB_USER: kifarunixuser\n      WORDPRESS_DB_PASSWORD: ChangeME\n      WORDPRESS_DB_NAME: kifarunixdb\n    volumes:\n      - wordpress:\/var\/www\/html\n\n  db:\n    image: mariadb\n    container_name: mariadb\n    restart: unless-stopped\n    environment:\n      MYSQL_DATABASE: kifarunixdb\n      MYSQL_USER: kifarunixuser\n      MYSQL_PASSWORD: ChangeME\n      MARIADB_ROOT_PASSWORD: ChangeME\n    volumes:\n      - db:\/var\/lib\/mysql\n\nvolumes:\n  wordpress:\n  db:\n<\/code><\/pre>\n\n\n\n<p>Save and exit the file, of course after making your appropriate changes.<\/p>\n\n\n\n<p>So, what makes up a compose file? Let&#8217;s demystify the above;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Version:<\/strong> Specifies the version of the Docker Compose configuration. In this case, it&#8217;s version 3.<\/li>\n\n\n\n<li><strong>Services:<\/strong> Defines the containers that make up the application.\n<ul class=\"wp-block-list\">\n<li><strong>wordpress:<\/strong> The WordPress service container.\n<ul class=\"wp-block-list\">\n<li><strong>image:<\/strong> Specifies the Docker image to use for the WordPress container. In this case, it&#8217;s the official WordPress image from Docker Hub.<\/li>\n\n\n\n<li><strong>container_name<\/strong>: Defines custom-container-name of the container. It overrides the default container name that Docker Compose would generate based on the service name and a unique identifier.<\/li>\n\n\n\n<li><strong>restart:<\/strong> Specifies that the container should restart unless explicitly stopped. This ensures that Docker will automatically restart the container if it stops for any reason, except when explicitly stopped by the user.<\/li>\n\n\n\n<li><strong>ports:<\/strong> Maps port 8080 on the host to port 80 in the container, allowing you to access the WordPress site at <code>http:\/\/*:8080<\/code>.<\/li>\n\n\n\n<li><strong>environment:<\/strong> Sets environment variables for the WordPress container, such as database host, user, password, and database name.<\/li>\n\n\n\n<li><strong>volumes:<\/strong> Creates a volume called <code>wordpress<\/code> that&#8217;s mounted to <code>\/var\/www\/html<\/code> in the container. This allows you to persist WordPress files and data even if the container is recreated.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>db:<\/strong> The MariaDB database service container.\n<ul class=\"wp-block-list\">\n<li><strong>image:<\/strong> Specifies the Docker image to use for the database container. In this case, it&#8217;s the official MariaDB image from Docker Hub.<\/li>\n\n\n\n<li><strong>restart:<\/strong> Specifies that the container should restart unless explicitly stopped, ensuring the database remains available.<\/li>\n\n\n\n<li><strong>environment:<\/strong> Sets environment variables for the database container, including database name, user, passwords, and root password.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>volumes:<\/strong> Creates a named volume named <code>db<\/code> that&#8217;s mounted to <code>\/var\/lib\/mysql<\/code> in the container. This allows you to persist the database data even if the container is recreated.<\/li>\n<\/ul>\n\n\n\n<p>Read more on <a href=\"https:\/\/docs.docker.com\/compose\/compose-file\/compose-file-v3\/\" target=\"_blank\" rel=\"noreferrer noopener\">compose-file reference page<\/a>.<\/p>\n\n\n\n<p>The above is enough to get you started.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"deploy-word-press-app-using-docker-compose\">Deploy WordPress App using Docker Compose<\/h3>\n\n\n\n<p>Once you have a docker compose yaml file, you can the command below to check the validity of the YAML file;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose config<\/code><\/pre>\n\n\n\n<p>If the YAML file is a different directory apart from the current directory, ensure to specify that path using <strong><code>-f<\/code><\/strong> option;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose -f wordpress\/docker-compose.yaml config<\/code><\/pre>\n\n\n\n<p>If the contents of the YAML file are printed to stdout, then all is good. otherwise, if there is any error, it is also shown to you.<\/p>\n\n\n\n<p>If all is good, you can launch the WordPress app containers using the command below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up<\/code><\/pre>\n\n\n\n<p>Similarly, specify the path to compose file using option -f.<\/p>\n\n\n\n<p>The above command launches docker containers on foreground.<\/p>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n[+] Running 9\/9\n \u2714 db 8 layers [\u28ff\u28ff\u28ff\u28ff\u28ff\u28ff\u28ff\u28ff]      0B\/0B      Pulled                                                                                                                       8.5s \n   \u2714 9d19ee268e0d Pull complete                                                                                                                                        2.9s \n   \u2714 718e898a86ff Pull complete                                                                                                                                        3.0s \n   \u2714 43bd7a143a6c Pull complete                                                                                                                                        3.5s \n   \u2714 80cdf483b70a Pull complete                                                                                                                                        3.5s \n   \u2714 8c13b197eea7 Pull complete                                                                                                                                        3.6s \n   \u2714 fe76c18bf258 Pull complete                                                                                                                                        6.6s \n   \u2714 67fa5c829e7f Pull complete                                                                                                                                        6.6s \n   \u2714 a5cb79f31ff6 Pull complete                                                                                                                                        6.7s \n[+] Running 5\/5\n \u2714 Network wordpress_default        Created                                                                                                                            0.1s \n \u2714 Volume \"wordpress_wordpress\"     Created                                                                                                                            0.0s \n \u2714 Volume \"wordpress_db\"            Created                                                                                                                            0.0s \n \u2714 Container mariadb         Created                                                                                                                            0.5s \n \u2714 Container wordpress  Created                                                                                                                            0.5s \nAttaching to mariadb, wordpress\nwordpress  | WordPress not found in \/var\/www\/html - copying now...\nmariadb         | 2023-08-08 18:00:36+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.\nmariadb         | 2023-08-08 18:00:36+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'\nmariadb         | 2023-08-08 18:00:36+00:00 [Note] [Entrypoint]: Entrypoint script for MariaDB Server 1:11.0.2+maria~ubu2204 started.\nmariadb         | 2023-08-08 18:00:37+00:00 [Note] [Entrypoint]: Initializing database files\nwordpress  | Complete! WordPress has been successfully copied to \/var\/www\/html\nwordpress  | No 'wp-config.php' found in \/var\/www\/html, but 'WORDPRESS_...' variables supplied; copying 'wp-config-docker.php' (WORDPRESS_DB_HOST WORDPRESS_DB_NAME WORDPRESS_DB_PASSWORD WORDPRESS_DB_USER)\nwordpress  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.2. Set the 'ServerName' directive globally to suppress this message\nwordpress  | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.21.0.2. Set the 'ServerName' directive globally to suppress this message\nwordpress  | [Tue Aug 08 18:00:39.426271 2023] [mpm_prefork:notice] [pid 1] AH00163: Apache\/2.4.56 (Debian) PHP\/8.0.29 configured -- resuming normal operations\nwordpress  | [Tue Aug 08 18:00:39.428004 2023] [core:notice] [pid 1] AH00094: Command line: 'apache2 -D FOREGROUND'\nmariadb         | \nmariadb         | \nmariadb         | \nmariadb         | \nmariadb         | PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !\nmariadb         | To do so, start the server, then issue the following command:\nmariadb         | \nmariadb         | \nmariadb         | '\/usr\/bin\/mariadb-secure-installation'\nmariadb         | \nmariadb         | \nmariadb         | which will also give you the option of removing the test\nmariadb         | databases and anonymous user created by default.  This is\nmariadb         | strongly recommended for production servers.\nmariadb         | \nmariadb         | \nmariadb         | See the MariaDB Knowledgebase at https:\/\/mariadb.com\/kb\nmariadb         | \nmariadb         | \nmariadb         | Please report any problems at https:\/\/mariadb.org\/jira\nmariadb         | \nmariadb         | \nmariadb         | The latest information about MariaDB is available at https:\/\/mariadb.org\/.\nmariadb         | \nmariadb         | \nmariadb         | Consider joining MariaDB's strong and vibrant community:\nmariadb         | https:\/\/mariadb.org\/get-involved\/\nmariadb         | \nmariadb         | \nmariadb         | 2023-08-08 18:00:41+00:00 [Note] [Entrypoint]: Database files initialized\nmariadb         | 2023-08-08 18:00:41+00:00 [Note] [Entrypoint]: Starting temporary server\nmariadb         | 2023-08-08 18:00:41+00:00 [Note] [Entrypoint]: Waiting for server startup\nmariadb         | 2023-08-08 18:00:41 0 [Note] Starting MariaDB 11.0.2-MariaDB-1:11.0.2+maria~ubu2204 source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 97\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Compressed tables use zlib 1.2.11\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Number of transaction pools: 1\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions\nmariadb         | 2023-08-08 18:00:41 0 [Note] mariadbd: O_TMPFILE is not supported on \/tmp (disabling future attempts)\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Using liburing\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Completed initialization of buffer pool\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Opened 3 undo tablespaces\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: Setting file '.\/ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: File '.\/ibtmp1' size is now 12.000MiB.\nmariadb         | 2023-08-08 18:00:41 0 [Note] InnoDB: log sequence number 47243; transaction id 14\nmariadb         | 2023-08-08 18:00:41 0 [Note] Plugin 'FEEDBACK' is disabled.\nmariadb         | 2023-08-08 18:00:41 0 [Note] Plugin 'wsrep-provider' is disabled.\nmariadb         | 2023-08-08 18:00:41 0 [Warning] 'user' entry 'root@8d74673d77aa' ignored in --skip-name-resolve mode.\nmariadb         | 2023-08-08 18:00:41 0 [Warning] 'proxies_priv' entry '@% root@8d74673d77aa' ignored in --skip-name-resolve mode.\nmariadb         | 2023-08-08 18:00:41 0 [Note] mariadbd: ready for connections.\nmariadb         | Version: '11.0.2-MariaDB-1:11.0.2+maria~ubu2204'  socket: '\/run\/mysqld\/mysqld.sock'  port: 0  mariadb.org binary distribution\nmariadb         | 2023-08-08 18:00:42+00:00 [Note] [Entrypoint]: Temporary server started.\nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: Creating database kifarunixdb\nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: Creating user kifarunixuser\nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: Giving user kifarunixuser access to schema kifarunixdb\nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: Securing system users (equivalent to running mysql_secure_installation)\nmariadb         | \nmariadb         | \nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: Stopping temporary server\nmariadb         | 2023-08-08 18:00:44 0 [Note] mariadbd (initiated by: unknown): Normal shutdown\nmariadb         | 2023-08-08 18:00:44 0 [Note] InnoDB: FTS optimize thread exiting.\nmariadb         | 2023-08-08 18:00:44 0 [Note] InnoDB: Starting shutdown...\nmariadb         | 2023-08-08 18:00:44 0 [Note] InnoDB: Dumping buffer pool(s) to \/var\/lib\/mysql\/ib_buffer_pool\nmariadb         | 2023-08-08 18:00:44 0 [Note] InnoDB: Buffer pool(s) dump completed at 230808 18:00:44\nmariadb         | 2023-08-08 18:00:44 0 [Note] InnoDB: Removed temporary tablespace data file: \".\/ibtmp1\"\nmariadb         | 2023-08-08 18:00:44 0 [Note] InnoDB: Shutdown completed; log sequence number 47243; transaction id 15\nmariadb         | 2023-08-08 18:00:44 0 [Note] mariadbd: Shutdown complete\nmariadb         | \nmariadb         | \nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: Temporary server stopped\nmariadb         | \nmariadb         | \nmariadb         | 2023-08-08 18:00:44+00:00 [Note] [Entrypoint]: MariaDB init process done. Ready for start up.\nmariadb         | \nmariadb         | \nmariadb         | 2023-08-08 18:00:45 0 [Note] Starting MariaDB 11.0.2-MariaDB-1:11.0.2+maria~ubu2204 source revision 0005f2f06c8e1aea4915887decad67885108a929 as process 1\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Compressed tables use zlib 1.2.11\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Number of transaction pools: 1\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Using crc32 + pclmulqdq instructions\nmariadb         | 2023-08-08 18:00:45 0 [Note] mariadbd: O_TMPFILE is not supported on \/tmp (disabling future attempts)\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Using liburing\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Initializing buffer pool, total size = 128.000MiB, chunk size = 2.000MiB\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Completed initialization of buffer pool\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: File system buffers for log disabled (block size=512 bytes)\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Opened 3 undo tablespaces\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: 128 rollback segments in 3 undo tablespaces are active.\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Setting file '.\/ibtmp1' size to 12.000MiB. Physically writing the file full; Please wait ...\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: File '.\/ibtmp1' size is now 12.000MiB.\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: log sequence number 47243; transaction id 14\nmariadb         | 2023-08-08 18:00:45 0 [Note] Plugin 'FEEDBACK' is disabled.\nmariadb         | 2023-08-08 18:00:45 0 [Note] Plugin 'wsrep-provider' is disabled.\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Loading buffer pool(s) from \/var\/lib\/mysql\/ib_buffer_pool\nmariadb         | 2023-08-08 18:00:45 0 [Note] Server socket created on IP: '0.0.0.0'.\nmariadb         | 2023-08-08 18:00:45 0 [Note] Server socket created on IP: '::'.\nmariadb         | 2023-08-08 18:00:45 0 [Note] InnoDB: Buffer pool(s) load completed at 230808 18:00:45\nmariadb         | 2023-08-08 18:00:45 0 [Note] mariadbd: ready for connections.\nmariadb         | Version: '11.0.2-MariaDB-1:11.0.2+maria~ubu2204'  socket: '\/run\/mysqld\/mysqld.sock'  port: 3306  mariadb.org binary distribution\n<\/code><\/pre>\n\n\n\n<p>If you open another another terminal and check the running containers;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps<\/code><\/pre>\n\n\n\n<p>Sample output;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\nCONTAINER ID   IMAGE       COMMAND                  CREATED              STATUS              PORTS                                   NAMES\n8aff673f761e   mariadb     \"docker-entrypoint.s\u2026\"   About a minute ago   Up About a minute   3306\/tcp                                mariadb\na85a0d0d0c57   wordpress   \"docker-entrypoint.s\u2026\"   About a minute ago   Up About a minute   0.0.0.0:8080->80\/tcp, :::8080->80\/tcp   wordpress\n<\/code><\/pre>\n\n\n\n<p>To run the containers in background, simply press <strong>Ctrl+c<\/strong> and rerun the command with option <strong><code>-d<\/code><\/strong>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up -d<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\n[+] Running 2\/2\n \u2714 Container mariadb    Started                                                                                                                                        0.6s \n \u2714 Container wordpress  Started                                                                                                                                        0.4s \n<\/code><\/pre>\n\n\n\n<p>You should now be able to access your WordPress app using either IP or domain (<strong><code>http:\/\/&lt;IP&gt;|&lt;domain&gt;:8080<\/code><\/strong>) since none is enforced here.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1352\" height=\"699\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-with-defaut-apache.png\" alt=\"Deploy WordPress using Docker Compose\" class=\"wp-image-18260\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-with-defaut-apache.png?v=1691522274 1352w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-with-defaut-apache-768x397.png?v=1691522274 768w\" sizes=\"(max-width: 1352px) 100vw, 1352px\" \/><\/figure>\n\n\n\n<p>You can list the volumes created by the containers;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker volume ls<\/code><\/pre>\n\n\n\n<p>List the networks;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker network ls<\/code><\/pre>\n\n\n\n<p>Delete the containers and networks;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose down<\/code><\/pre>\n\n\n\n<p>For more docker-compose options, check;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose --help<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"word-press-container-extra-configurations\">WordPress Container Extra Configurations<\/h3>\n\n\n\n<p>There are <a href=\"https:\/\/developer.wordpress.org\/apis\/wp-config-php\/\" target=\"_blank\" rel=\"noreferrer noopener\">other extra configs<\/a> that you can use for the WordPress container apart from the basic environment variables that are usually used by default. Such extra configs can be defined using WORDPRESS_CONFIG_EXTRA variable.<\/p>\n\n\n\n<p>See example options here;<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>WP_DEBUG<\/code>: When set to true, this enables debugging mode in WordPress, providing more detailed error messages in case of issues.<\/li>\n\n\n\n<li><code>WP_POST_REVISIONS<\/code>: Sets the maximum number of post revisions to be stored. In this case, it&#8217;s set to 5.<\/li>\n\n\n\n<li><code>WP_MEMORY_LIMIT<\/code>: Defines the maximum amount of memory that WordPress can use. Here, it&#8217;s set to 256 megabytes.<\/li>\n\n\n\n<li><code>DISABLE_WP_CRON<\/code>: When true, it disables the built-in WordPress cron system, which can be useful when using an external cron job system.<\/li>\n\n\n\n<li><code>AUTOMATIC_UPDATER_DISABLED<\/code>: If true, this prevents WordPress from automatically updating itself.<\/li>\n\n\n\n<li><code>WP_CACHE<\/code>: When true, it enables the use of caching for improved performance.<\/li>\n\n\n\n<li><code>WP_HOME<\/code> and <code>WP_SITEURL<\/code>: These define the base URLs for the WordPress installation.<\/li>\n\n\n\n<li><code>FS_METHOD<\/code>: Sets the method used for file operations. &#8216;direct&#8217; indicates direct file system access without FTP.<\/li>\n\n\n\n<li><code>FTP_USER<\/code> and <code>FTP_PASS<\/code>: These are the FTP credentials used for file operations if FTP is required.<\/li>\n\n\n\n<li><code>FORCE_SSL_ADMIN<\/code>: Enforces the use of SSL for the WordPress admin dashboard.<\/li>\n\n\n\n<li><code>DISALLOW_FILE_MODS<\/code>: Prevents file modification through the WordPress admin interface.<\/li>\n\n\n\n<li><code>DISALLOW_FILE_EDIT<\/code>: Disallows editing of theme and plugin files through the WordPress admin interface.<\/li>\n<\/ul>\n\n\n\n<p>These are just but a few.<\/p>\n\n\n\n<p>You would use them in the compose file as;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\nservices:\n\n  wordpress:\n    image: wordpress\n    container_name: wordpress\n    restart: unless-stopped\n    ports:\n      - 8080:80\n    environment:\n      WORDPRESS_DB_HOST: db\n      WORDPRESS_DB_USER: kifarunixuser\n      WORDPRESS_DB_PASSWORD: ChangeME\n      WORDPRESS_DB_NAME: kifarunixdb\n<strong>      WORDPRESS_CONFIG_EXTRA: |\n        define( 'WP_DEBUG', true );\n        define( 'WP_POST_REVISIONS', 5 );\n        define( 'WP_MEMORY_LIMIT', '256M' );\n        define( 'DISABLE_WP_CRON', true );\n        define( 'AUTOMATIC_UPDATER_DISABLED', true );\n        define( 'WP_CACHE', true );\n        define( 'WP_HOME', 'https:\/\/www.example.com' );\n        define( 'WP_SITEURL', 'https:\/\/www.example.com' );\n        define( 'FS_METHOD', 'direct' );\n        define( 'FTP_USER', 'username' );\n        define( 'FTP_PASS', 'password' );\n        define( 'FORCE_SSL_ADMIN', true );\n        define( 'DISALLOW_FILE_MODS', true );\n        define( 'DISALLOW_FILE_EDIT', true );<\/strong>\n    volumes:\n      - wordpress:\/var\/www\/html\n...\n...\n<\/code><\/pre>\n\n\n\n<p>That is just an example usage.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-word-press-container-with-nginx\">Run WordPress Container with Nginx<\/h3>\n\n\n\n<p>By default, WordPress uses Apache web server. You can confirm this by inspecting the wordpress container;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker inspect wordpress<\/code><\/pre>\n\n\n\n<p>To configure it to use Nginx, edit the compose file as follows;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim docker-compose.yaml<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nversion: '3'\n\nservices:\n\n  wordpress:\n    image: wordpress\n    container_name: wordpress\n    restart: unless-stopped\n#    ports:\n#      - 8080:80\n    environment:\n      WORDPRESS_DB_HOST: db\n      WORDPRESS_DB_USER: kifarunixuser\n      WORDPRESS_DB_PASSWORD: ChangeME\n      WORDPRESS_DB_NAME: kifarunixdb\n<strong>      WORDPRESS_CONFIG_EXTRA: |\n        define( 'WP_HOME', 'http:\/\/kifarunix-demo.com' );\n        define( 'WP_SITEURL', 'http:\/\/kifarunix-demo.com' );<\/strong>\n    volumes:\n      - wordpress:\/var\/www\/html\n\n  db:\n    image: mariadb\n    container_name: mariadb\n    restart: unless-stopped\n    environment:\n      MYSQL_DATABASE: kifarunixdb\n      MYSQL_USER: kifarunixuser\n      MYSQL_PASSWORD: ChangeME\n      MARIADB_ROOT_PASSWORD: ChangeME\n    volumes:\n      - db:\/var\/lib\/mysql\n\n<strong>  nginx:\n    image: nginx:latest\n    container_name: nginx\n    restart: always\n    ports:\n      - 80:80\n    volumes:\n      - .\/nginx\/conf.d:\/etc\/nginx\/conf.d\n    depends_on:\n      - wordpress<\/strong>\n\nvolumes:\n  wordpress:\n  db:\n<\/code><\/pre>\n\n\n\n<p>Update compose file accordingly.<\/p>\n\n\n\n<p>Ensure that Nginx configuration directory exists on the host;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p nginx\/conf.d<\/code><\/pre>\n\n\n\n<p>Also ensure that you have the site configuration;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx\/conf.d\/default.conf<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nserver {\n    listen 80;\n    server_name kifarunix-demo.com;\n\n    location \/ {\n        proxy_pass http:\/\/wordpress:80;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n\n    location ~ \/\\.well-known\/acme-challenge {\n        allow all;\n        root \/var\/www\/html;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>Update the configs accordingly.<\/p>\n\n\n\n<p>When done, start WordPress with Nginx web server.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose down<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up -d<\/code><\/pre>\n\n\n\n<p>Confirm the services;<\/p>\n\n\n\n<pre class=\"scroll-sz\"><code>\nCONTAINER ID   IMAGE          COMMAND                  CREATED         STATUS         PORTS                               NAMES\n38e4ac7cf507   nginx:latest   \"\/docker-entrypoint.\u2026\"   6 seconds ago   Up 5 seconds   0.0.0.0:80->80\/tcp, :::80->80\/tcp   nginx\n5b0dc0ac47bc   mariadb        \"docker-entrypoint.s\u2026\"   6 seconds ago   Up 6 seconds   3306\/tcp                            mariadb\neac3752c9579   wordpress      \"docker-entrypoint.s\u2026\"   6 seconds ago   Up 6 seconds   80\/tcp                              wordpress\n<\/code><\/pre>\n\n\n\n<p>You can then access your wordpress using the address defined, <strong>http:\/\/kifarunix-demo.com<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1322\" height=\"772\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-app.png\" alt=\"Deploy WordPress using Docker Compose\" class=\"wp-image-18259\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-app.png?v=1691521779 1322w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-app-768x448.png?v=1691521779 768w\" sizes=\"(max-width: 1322px) 100vw, 1322px\" \/><\/figure>\n\n\n\n<p>You can then proceed to complete the setup of your WordPress site.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"run-word-press-container-with-ssl-tls\">Run WordPress Container with SSL\/TLS<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"configure-ssl-tls-with-the-default-apache-web-server\">Configure SSL\/TLS with the default Apache Web Server<\/h4>\n\n\n\n<p>If you want to run WordPress with SSL\/TLS using the default Apache it is bundled with, then you have to rebuild the wordpress image to enable SSL modules.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim Dockerfile<\/code><\/pre>\n\n\n\n<p>Enter;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>FROM wordpress:latest\n\nRUN a2enmod ssl rewrite<\/code><\/pre>\n\n\n\n<p>Save the file and recreate the WordPress image;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker build -t wordpress:ssl .<\/code><\/pre>\n\n\n\n<p>You should now have a custom WordPress image;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker images<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nREPOSITORY            TAG       IMAGE ID       CREATED          SIZE\n<strong>wordpress             ssl       c47a8aa8ec4b   58 seconds ago   664MB<\/strong>\nwordpress             latest    b94fa4376c73   10 days ago      664MB\nmariadb               latest    011343cf3ec3   5 weeks ago      403MB\n<\/code><\/pre>\n\n\n\n<p>Next, create your custom HTTP\/HTTPS Apache configuration;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir apache<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>vim apache\/kifarunix-demo.conf<\/code><\/pre>\n\n\n\n<p>Sample config with redirection;<\/p>\n\n\n\n<pre class=\"scroll-box\"><code>\n&lt;VirtualHost *:80>\n    ServerName kifarunix-demo.com\n    Redirect permanent \/ https:\/\/kifarunix-demo.com\/\n&lt;\/VirtualHost>\n\n&lt;VirtualHost *:443>\n    ServerName kifarunix-demo.com\n    DocumentRoot \/var\/www\/html\n\n    SSLEngine on\n    SSLCertificateFile \/etc\/apache2\/ssl\/ssl.crt\n    SSLCertificateKeyFile \/etc\/apache2\/ssl\/ssl.key\n\n    &lt;FilesMatch \"\\.(cgi|shtml|phtml|php)$\">\n        SSLOptions +StdEnvVars\n    &lt;\/FilesMatch>\n    &lt;Directory \/usr\/lib\/cgi-bin>\n        SSLOptions +StdEnvVars\n    &lt;\/Directory>\n&lt;\/VirtualHost>\n<\/code><\/pre>\n\n\n\n<p>Update your configs accordingly.<\/p>\n\n\n\n<p>Provide SSL\/TLS certs;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir apache\/ssl<\/code><\/pre>\n\n\n\n<p>I have put ssl certs in there;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -1 apache\/ssl\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ssl.crt\nssl.key<\/code><\/pre>\n\n\n\n<p>Update your compose file accordingly;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim docker-compose.yaml<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nversion: '3'\n\nservices:\n\n  wordpress:\n    <strong>image: wordpress:ssl<\/strong>\n    container_name: wordpress\n    restart: unless-stopped\n<strong>    ports:\n      - 80:80\n      - 443:443<\/strong>\n    environment:\n      WORDPRESS_DB_HOST: db\n      WORDPRESS_DB_USER: kifarunixuser\n      WORDPRESS_DB_PASSWORD: ChangeME\n      WORDPRESS_DB_NAME: kifarunixdb\n<strong>      WORDPRESS_CONFIG_EXTRA: |\n        define( 'WP_HOME', 'https:\/\/kifarunix-demo.com' );\n        define( 'WP_SITEURL', 'https:\/\/kifarunix-demo.com');<\/strong>\n    volumes:\n      - wordpress:\/var\/www\/html\n<strong>      - .\/apache\/ssl:\/etc\/apache2\/ssl\n      - .\/apache\/kifarunix-demo.conf:\/etc\/apache2\/sites-enabled\/000-default.conf<\/strong>\n\n  db:\n    image: mariadb\n    container_name: mariadb\n    restart: unless-stopped\n    environment:\n      MYSQL_DATABASE: kifarunixdb\n      MYSQL_USER: kifarunixuser\n      MYSQL_PASSWORD: ChangeME\n      MARIADB_ROOT_PASSWORD: ChangeME\n    volumes:\n      - db:\/var\/lib\/mysql\n\nvolumes:\n  wordpress:\n  db:\n<\/code><\/pre>\n\n\n\n<p>See highlighted sections for what we changed\/updated.<\/p>\n\n\n\n<p>Save the compose file and bring up WordPress using Apache with SSL\/TLS.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose down<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up -d<\/code><\/pre>\n\n\n\n<p>Confirm;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker ps<\/code><\/pre>\n\n\n\n<pre class=\"scroll-sz\"><code>\nCONTAINER ID   IMAGE           COMMAND                  CREATED         STATUS         PORTS                                                                      NAMES\n2b9f1b6dc1a8   wordpress:ssl   \"docker-entrypoint.s\u2026\"   4 seconds ago   Up 2 seconds   0.0.0.0:80->80\/tcp, :::80->80\/tcp, 0.0.0.0:443->443\/tcp, :::443->443\/tcp   wordpress\nea763f9a7baa   mariadb         \"docker-entrypoint.s\u2026\"   4 seconds ago   Up 2 seconds   3306\/tcp                                                                   mariadb\n<\/code><\/pre>\n\n\n\n<p>Access your WordPress from browser. It should redirect HTTP to HTTPS;<\/p>\n\n\n\n<figure class=\"gb-block-image gb-block-image-8df45b7b\"><img loading=\"lazy\" decoding=\"async\" width=\"1314\" height=\"724\" class=\"gb-image gb-image-8df45b7b\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-https-apache.png\" alt=\"\" title=\"wordpress-container-https-apache\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-https-apache.png?v=1691525783 1314w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-https-apache-768x423.png?v=1691525783 768w\" sizes=\"(max-width: 1314px) 100vw, 1314px\"><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>Awesome! You are now serving HTTPS.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"configure-ssl-tls-with-nginx-web-server\">Configure SSL\/TLS with Nginx Web Server<\/h4>\n\n\n\n<p>If you dont want to update the WordPress image, then you can use Nginx image.<\/p>\n\n\n\n<p>We will update Nginx configs above as follows.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir nginx\/ssl<\/code><\/pre>\n\n\n\n<p>Put your SSL certs there;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -1 nginx\/ssl\/<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>ssl.crt\nssl.key<\/code><\/pre>\n\n\n\n<p>Update the default config.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim nginx\/conf.d\/default.conf<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nserver {\n    listen 80;\n    server_name kifarunix-demo;\n    return 301 https:\/\/$host$request_uri;\n}\n\nserver {\n    listen 443 ssl;\n    server_name kifarunix-demo;\n\n    ssl_certificate \/etc\/nginx\/certs\/ssl.crt;\n    ssl_certificate_key \/etc\/nginx\/certs\/ssl.key;\n\n    location \/ {\n        proxy_pass http:\/\/wordpress:80;\n        proxy_set_header Host $host;\n        proxy_set_header X-Real-IP $remote_addr;\n        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n        proxy_set_header X-Forwarded-Proto $scheme;\n    }\n\n    location ~ \/\\.well-known\/acme-challenge {\n        allow all;\n        root \/var\/www\/html;\n    }\n}\n<\/code><\/pre>\n\n\n\n<p>Update the compose file;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim docker-compose.yaml<\/code><\/pre>\n\n\n\n<pre class=\"scroll-box\"><code>\nversion: '3'\n\nservices:\n\n  wordpress:\n    image: wordpress\n    container_name: wordpress\n    restart: unless-stopped\n#    ports:\n#      - 8080:80\n    environment:\n      WORDPRESS_DB_HOST: db\n      WORDPRESS_DB_USER: kifarunixuser\n      WORDPRESS_DB_PASSWORD: ChangeME\n      WORDPRESS_DB_NAME: kifarunixdb\n    volumes:\n      - wordpress:\/var\/www\/html\n\n  db:\n    image: mariadb\n    container_name: mariadb\n    restart: unless-stopped\n    environment:\n      MYSQL_DATABASE: kifarunixdb\n      MYSQL_USER: kifarunixuser\n      MYSQL_PASSWORD: ChangeME\n      MARIADB_ROOT_PASSWORD: ChangeME\n      WORDPRESS_CONFIG_EXTRA: |\n        define( 'WP_HOME', 'https:\/\/kifarunix-demo.com' );\n        define( 'WP_SITEURL', 'https:\/\/kifarunix-demo.com' );\n    volumes:\n      - db:\/var\/lib\/mysql\n\n  nginx:\n    image: nginx:latest\n    container_name: nginx\n    restart: always\n    ports:\n      - 80:80\n      - 443:443\n    volumes:\n      - .\/nginx\/conf.d:\/etc\/nginx\/conf.d\n      - .\/nginx\/ssl:\/etc\/nginx\/certs\n    depends_on:\n      - wordpress\n\nvolumes:\n  wordpress:\n  db:\n<\/code><\/pre>\n\n\n\n<p>Save and exit.<\/p>\n\n\n\n<p>Run the WordPress container;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose down<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>docker-compose up -d<\/code><\/pre>\n\n\n\n<p>You should be able to access your WordPress site using HTTPS served by Nginx.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1314\" height=\"724\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-https-apache-1.png\" alt=\"\" class=\"wp-image-18264\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-https-apache-1.png?v=1691526652 1314w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-container-https-apache-1-768x423.png?v=1691526652 768w\" sizes=\"(max-width: 1314px) 100vw, 1314px\" \/><\/figure>\n\n\n\n<p>Setup success;<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1047\" height=\"524\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-docker-compose-success.png\" alt=\"\" class=\"wp-image-18265\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-docker-compose-success.png?v=1691526669 1047w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-docker-compose-success-768x384.png?v=1691526669 768w\" sizes=\"(max-width: 1047px) 100vw, 1047px\" \/><\/figure>\n\n\n\n<p>And finally!<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1470\" height=\"822\" src=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-docker-container.png\" alt=\"\" class=\"wp-image-18266\" title=\"\" srcset=\"https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-docker-container.png?v=1691526686 1470w, https:\/\/kifarunix.com\/wp-content\/uploads\/2023\/08\/wordpress-docker-container-768x429.png?v=1691526686 768w\" sizes=\"(max-width: 1470px) 100vw, 1470px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h3>\n\n\n\n<p>You have successfully deployed WordPress app using docker compose.<\/p>\n\n\n\n<p>That marks the end of our tutorial on deploying WordPress using Docker compose.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, you will learn how to deploy WordPress using Docker compose. In an ever-evolving digital landscape, where websites serve as essential touch-points for<\/p>\n","protected":false},"author":10,"featured_media":18265,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[1076,1077,121,34,1187,292],"tags":[7159,7160,7161,7164,7162],"class_list":["post-18250","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-containers","category-docker","category-howtos","category-security","category-ssl-tls","category-wordpress","tag-deploy-wordpress-using-docker-compose","tag-docker-compose-file-for-wordpress","tag-wordpress-app-docker-compose","tag-wordpress-container-ssl-tls-apache","tag-wordpress-with-nginx-ssl-tls","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18250"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=18250"}],"version-history":[{"count":15,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18250\/revisions"}],"predecessor-version":[{"id":20818,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/18250\/revisions\/20818"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/18265"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=18250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=18250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=18250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}