{"id":15027257,"url":"https://github.com/pabloripoll/docker-wordpress-6.4-php-8","last_synced_at":"2026-03-27T04:57:11.612Z","repository":{"id":225719528,"uuid":"766663018","full_name":"pabloripoll/docker-wordpress-6.4-php-8","owner":"pabloripoll","description":"Docker container for Wordpress 6.4 with PHP FPM 8+ and Nginx 1.24 on Alpine 3.19","archived":false,"fork":false,"pushed_at":"2024-04-05T14:44:43.000Z","size":42363,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T20:29:34.701Z","etag":null,"topics":["alpine","docker","docker-compose","mariadb","mysql","nginx","php8","php81","php82","php83","wordress"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pabloripoll.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-03T21:36:23.000Z","updated_at":"2024-03-09T22:41:07.000Z","dependencies_parsed_at":"2025-01-19T20:38:24.416Z","dependency_job_id":null,"html_url":"https://github.com/pabloripoll/docker-wordpress-6.4-php-8","commit_stats":null,"previous_names":["pabloripoll/docker-wordpress-6-4-php-8.3","pabloripoll/docker-wordpress-6-4-php-fpm","pabloripoll/docker-wordpress-6.4-php-8"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-wordpress-6.4-php-8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-wordpress-6.4-php-8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-wordpress-6.4-php-8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-wordpress-6.4-php-8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabloripoll","download_url":"https://codeload.github.com/pabloripoll/docker-wordpress-6.4-php-8/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243330319,"owners_count":20274039,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine","docker","docker-compose","mariadb","mysql","nginx","php8","php81","php82","php83","wordress"],"created_at":"2024-09-24T20:06:04.786Z","updated_at":"2025-12-29T02:08:08.725Z","avatar_url":"https://github.com/pabloripoll.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv style=\"width:100%;float:left;clear:both;margin-bottom:50px;\"\u003e\n    \u003ca href=\"https://github.com/pabloripoll?tab=repositories\"\u003e\n        \u003cimg style=\"width:150px;float:left;\" src=\"https://pabloripoll.com/files/logo-light-100x300.png\"/\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n# Docker Wordpress 6.4 with PHP FPM 8+\n\nThe objective of this repository is having a CaaS [Containers as a Service](https://www.ibm.com/topics/containers-as-a-service) to provide a \"ready to use\" container with the basic enviroment features to deploy a [WordPress](https://wordpress.org) application service under a lightweight Linux Alpine image with Nginx server platform and [PHP-FPM](https://www.php.net/manual/en/install.fpm.php) for development stage requirements.\n\nThe container configuration is as [Host Network](https://docs.docker.com/network/drivers/host/) on `eth0` as [Bridge network](https://docs.docker.com/network/drivers/bridge/), thus it can be accessed through `localhost:${PORT}` by browsers but to connect with it or this with other services `${HOSTNAME}:${PORT}` will be required.\n\n### Wordpress Docker Container Service\n\n- [Wordpress 6.4](https://wordpress.org/download/releases/6-4/)\n\n- [PHP-FPM 8.3](https://www.php.net/releases/8.3/en.php)\n\n- [Nginx 1.24](https://nginx.org/)\n\n- [Alpine Linux 3.19](https://www.alpinelinux.org/)\n\n### Database Container Service\n\nThis project does not include a database service for it is intended to connect to a database instance like in a cloud database environment or similar.\n\nTo emulate a SQL database service it can be used the following [MariaDB 10.11](https://mariadb.com/kb/en/changes-improvements-in-mariadb-1011/) repository:\n- [https://github.com/pabloripoll/docker-mariadb-10.11](https://github.com/pabloripoll/docker-mariadb-10.11)\n\n### Project objetives with Docker\n\n* Built on the lightweight and secure Alpine 3.19 [2024 release](https://www.alpinelinux.org/posts/Alpine-3.19.1-released.html) Linux distribution\n* Multi-platform, supporting AMD4, ARMv6, ARMv7, ARM64\n* Very small Docker image size (+/-40MB)\n* Uses PHP 8.3 as default for the best performance, low CPU usage \u0026 memory footprint, but also can be downgraded till PHP 8.0\n* Optimized for 100 concurrent users\n* Optimized to only use resources when there's traffic (by using PHP-FPM's `on-demand` process manager)\n* The services Nginx, PHP-FPM and supervisord run under a project-privileged user to make it more secure\n* The logs of all the services are redirected to the output of the Docker container (visible with `docker logs -f \u003ccontainer name\u003e`)\n* Follows the KISS principle (Keep It Simple, Stupid) to make it easy to understand and adjust the image to your needs\n* Services independency to connect the application to other database allocation\n\n#### PHP config\n\nTo use a different PHP 8 version the following [Dockerfile](docker/nginx-php/docker/Dockerfile) arguments and variable has to be modified:\n```Dockerfile\nARG PHP_VERSION=8.3\nARG PHP_ALPINE=83\n...\nENV PHP_V=\"php83\"\n```\n\nAlso, it has to be informed to [Supervisor Config](docker/nginx-php/docker/config/supervisord.conf) the PHP-FPM version to run.\n```bash\n...\n[program:php-fpm]\ncommand=php-fpm83 -F\n...\n```\n\n#### Containers on Windows systems\n\nThis project has not been tested on Windows OS neither I can use it to test it. So, I cannot bring much support on it.\n\nAnyway, using this repository you will needed to find out your PC IP by login as an `administrator user` to set connection between containers.\n\n```bash\nC:\\WINDOWS\\system32\u003eipconfig /all\n\nWindows IP Configuration\n\n Host Name . . . . . . . . . . . . : 191.128.1.41\n Primary Dns Suffix. . . . . . . . : paul.ad.cmu.edu\n Node Type . . . . . . . . . . . . : Peer-Peer\n IP Routing Enabled. . . . . . . . : No\n WINS Proxy Enabled. . . . . . . . : No\n DNS Suffix Search List. . . . . . : scs.ad.cs.cmu.edu\n```\n\nTake the first ip listed. Wordpress container will connect with database container using that IP.\n\n#### Containers on Unix based systems\n\nFind out your IP on UNIX systems and take the first IP listed\n```bash\n$ hostname -I\n\n191.128.1.41 172.17.0.1 172.20.0.1 172.21.0.1\n```\n\n## Structure\n\nDirectories and main files on a tree architecture description\n```\n.\n│\n├── docker\n│   └── nginx-php\n│       └── docker\n│       │   ├── config\n│       │   ├── .env\n│       │   ├── docker-compose.yml\n│       │   └── Dockerfile\n│       │\n│       └── Makefile\n│\n├── resources\n│   ├── database\n│   │   ├── wordpress-init.sql\n│   │   └── wordpress-backup.sql\n│   │\n│   ├── plugin\n│   │   ├── dev\n│   │   ├── (plugin-version)\n│   │   └── (plugin-version).zip\n│   │\n│   ├── theme\n│   │   ├── dev\n│   │   ├── (theme-version)\n│   │   └── (theme-version).zip\n│   │\n│   └── wordpress\n│       └── (any file or directory required for re-building the app...)\n│\n├── wordpress\n│   └── (application...)\n│\n├── .env\n├── .env.example\n└── Makefile\n```\n\n## Automation with Makefile\n\nMakefiles are often used to automate the process of building and compiling software on Unix-based systems as Linux and macOS.\n\n*On Windows - I recommend to use Makefile: \\\nhttps://stackoverflow.com/questions/2532234/how-to-run-a-makefile-in-windows*\n\nMakefile recipies\n```bash\n$ make help\nusage: make [target]\n\ntargets:\nMakefile  help                    shows this Makefile help message\nMakefile  hostname                shows local machine ip\nMakefile  fix-permission          sets project directory permission\nMakefile  host-check              shows this project ports availability on local machine\nMakefile  wordpress-ssh           enters the application container shell\nMakefile  wordpress-set           sets the application PHP enviroment file to build the container\nMakefile  wordpress-create        creates the application PHP container from Docker image\nMakefile  wordpress-start         starts the application PHP container running\nMakefile  wordpress-stop          stops the application PHP container but data will not be destroyed\nMakefile  wordpress-destroy       removes the application PHP from Docker network destroying its data and Docker image\nMakefile  wordpress-install       installs the application pre-defined version with its dependency packages into container\nMakefile  wordpress-update        updates the application dependency packages into container\nMakefile  database-install        installs into container database the init sql file from resources/database\nMakefile  database-replace        replaces container database with the latest sql backup file from resources/database\nMakefile  database-backup         creates / replace a sql backup file from container database in resources/database\nMakefile  repo-flush              clears local git repository cache specially to update .gitignore\n```\n\n## Service Configuration\n\nCreate a [DOTENV](.env) file from [.env.example](.env.example) and setup according to your project requirement the following variables\n```\n# REMOVE COMMENTS WHEN COPY THIS FILE\n\n# Leave it empty if no need for sudo user to execute docker commands\nDOCKER_USER=sudo\n\n# Container data for docker-compose.yml\nPROJECT_TITLE=\"WORDPRESS\"   # \u003c- this name will be prompt for Makefile recipes\nPROJECT_ABBR=\"wordpress\"    # \u003c- part of the service image tag - useful if similar services are running\n\n# Wordpress container\nPROJECT_HOST=\"127.0.0.1\"                    # \u003c- for this project is not necessary\nPROJECT_PORT=\"8888\"                         # \u003c- port access container service on local machine\nPROJECT_CAAS=\"wp-app\"                       # \u003c- container as a service name to build service\nPROJECT_PATH=\"../../../wordpress\"           # \u003c- path where application is binded from container to local\n\n# Database service container\nDB_CAAS=\"mariadb\"                           # \u003c- name of the database docker container service to access by ssh\nDB_NAME=\"mariadb\"                           # \u003c- name of the database to copy or replace\nDB_ROOT=\"7c4a8d09ca3762af61e59520943d\"      # \u003c- database root password\nDB_BACKUP_NAME=\"wordpress\"                    # \u003c- the name of the database backup or copy file\nDB_BACKUP_PATH=\"resources/database\"         # \u003c- path where database backup or copy resides\n```\n\nExacute the following command to create the [docker/.env](docker/.env) file, required for building the container\n```bash\n$ make wordpress-set\nWORPRESS docker-compose.yml .env file has been set.\n```\n\nCheckout port availability from the set enviroment\n```bash\n$ make host-check\n\nChecking configuration for WORPRESS container:\nWORPRESS \u003e port:8888 is free to use.\n```\n\nCheckout local machine IP to set connection between container services using the following makefile recipe if required\n```bash\n$ make hostname\n\n192.168.1.41\n```\n\n## Create the application container service\n```bash\n$ make worpress-create\n\nWORDPRESS docker-compose.yml .env file has been set.\n\n[+] Building 54.3s (26/26) FINISHED                                                 docker:default\n=\u003e [nginx-php internal] load build definition from Dockerfile                       0.0s\n =\u003e =\u003e transferring dockerfile: 2.78kB                                              0.0s\n =\u003e [nginx-php internal] load metadata for docker.io/library/composer:latest        1.5s\n =\u003e [nginx-php internal] load metadata for docker.io/library/php:8.3-fpm-alpine     1.5s\n =\u003e [nginx-php internal] load .dockerignore                                         0.0s\n =\u003e =\u003e transferring context: 108B                                                   0.0s\n =\u003e [nginx-php internal] load build context                                         0.0s\n =\u003e =\u003e transferring context: 8.30kB                                                 0.0s\n =\u003e [nginx-php] FROM docker.io/library/composer:latest@sha256:63c0f08ca41370...\n...\n =\u003e [nginx-php] exporting to image                                                  1.0s\n =\u003e =\u003e exporting layers                                                             1.0s\n =\u003e =\u003e writing image sha256:3c99f91a63edd857a0eaa13503c00d500fad57cf5e29ce1d...     0.0s\n =\u003e =\u003e naming to docker.io/library/wp-app:wp-nginx-php                              0.0s\n[+] Running 1/2\n ⠴ Network wp-app_default  Created                                                  0.4s\n ✔ Container wp-app        Started                                                  0.3s\n[+] Running 1/0\n ✔ Container wp-app        Running\n```\n\nIf container service has been built with the application content completed, accessing by browsing [http://localhost:8888/](http://localhost:8888/) will display the successful installation wizard page.\n\nIf container has been built without application, the following Makefile recipe will install the application that is configure in [docker/nginx-php/Makefile](docker/nginx-php/Makefile) service\n```bash\n$ make wordpress-install\n```\n\n## Container Information\n\nRunning container on Docker\n```bash\n$ sudo docker ps -a\nCONTAINER ID   IMAGE      COMMAND    CREATED      STATUS      PORTS                                             NAMES\necd27aeae010   word...    \"docker-php-entrypoi…\"  1 min...    9000/tcp, 0.0.0.0:8888-\u003e80/tcp, :::8888-\u003e80/tcp   wp-app\n```\n\nDocker image size\n```bash\n$ sudo docker images\nREPOSITORY   TAG           IMAGE ID       CREATED         SIZE\nwp-app       word...       373f6967199b   5 minutes ago   251MB\n```\n\nStats regarding the amount of disk space used by the container\n```bash\n$ sudo docker system df\nTYPE            TOTAL     ACTIVE    SIZE      RECLAIMABLE\nImages          1         1         251.4MB   0B (0%)\nContainers      1         1         4B        0B (0%)\nLocal Volumes   1         0         117.9MB   117.9MB (100%)\nBuild Cache     39        0         10.56kB   10.56kB\n```\n\n## Stopping the Container Service\n\nUsing the following Makefile recipe stops application from running, keeping database persistance and application files binded without any loss\n```bash\n$ make wordpress-stop\n[+] Stopping 1/1\n ✔ Container wp-app  Stopped                                                    0.5s\n```\n\n## Removing the Container Image\n\nTo remove application container from Docker network use the following Makefile recipe *(Docker prune commands still needed to be applied manually)*\n```bash\n$ make wordpress-destroy\n\n[+] Removing 1/0\n ✔ Container wp-app  Removed                                                     0.0s\n[+] Running 1/1\n ✔ Network wp-app_default  Removed                                               0.4s\nUntagged: wp-app:wp-nginx-php\nDeleted: sha256:3c99f91a63edd857a0eaa13503c00d500fad57cf5e29ce1da3210765259c35b1\n```\n\nInformation on pruning Docker system cache\n```bash\n$ sudo docker system prune\n\n...\nTotal reclaimed space: 168.4MB\n```\n\nInformation on pruning Docker volume cache\n```bash\n$ sudo docker system prune\n\n...\nTotal reclaimed space: 0MB\n```\n\n## Custom database service usage\n\nIn case of using the repository [https://github.com/pabloripoll/docker-mariadb-10.11](https://github.com/pabloripoll/docker-mariadb-10.11) as database service, complete the application mysql database connection params in [wordpress/wp-config.php](wordpress/wp-config.php) file.\n\nUse local hostname IP `$ make hostname` to set database host ip.\n\n```php\n/** The name of the database for WordPress */\ndefine( 'DB_NAME', 'mariadb' );\n\n/** Database username */\ndefine( 'DB_USER', 'mariadb' );\n\n/** Database password */\ndefine( 'DB_PASSWORD', '123456' );\n\n/** Database hostname */\ndefine( 'DB_HOST', '192.168.1.41:8880' );\n\n/** Database charset to use in creating database tables. */\ndefine( 'DB_CHARSET', 'utf8mb4' );\n\n/** The database collate type. Don't change this if in doubt. */\ndefine( 'DB_COLLATE', '' );\n```\n\n*(the above process also can be done automatically by using Composer package DOTENV - not included in this repository)*\n\n### Dumping Database\n\nEvery time the containers are built up and running it will be like start from a fresh installation.\n\nYou can continue using this repository with the pre-set database executing the command `$ make database-install`\n\nFollow the next recommendations to keep development stages clear and safe.\n\n*On first installation* once the app service is running with basic tables set, I suggest to make a initialization database backup manually, saving as [resources/database/wordpress-backup.sql](resources/database/wordpress-backup.sql) but renaming as [resources/database/wordpress-init.sql](resources/database/wordpress-init.sql) to have that init database for any Docker compose rebuild / restart on next time.\n\n**The following three commands are very useful for *Continue Development*.**\n\n### DB Backup\n\nWhen the project is already in an advanced development stage, making a backup is recommended to keep lastest database registers.\n```bash\n$ make database-backup\n\nDATABASE backup has been created.\n```\n\n### DB Install\n\nIf it is needed to restart the project from base installation step, you can use the init database .sql file to restart at that point in time. Although is not common to use, helps to check and test installation health.\n```bash\n$ make database-install\n\nDATABASE has been installed.\n```\n\nThis repository comes with an initialized .sql with a main database user. See [.env.example](.env.example)\n\n### DB Replace\n\nReplace the database set on container with the latest .sql backup into current development stage.\n```bash\n$ make database-replace\n\nDATABASE has been replaced.\n```\n\n#### Notes\n\n- Notice that both files in [resources/database/](resources/database/) have the name that has been set on the main `.env` file to automate processes.\n\n- Remember that on any change in the main `.env` file will be required to execute the following Makefile recipe\n```bash\n$ make wordpress-set\n\nWORDPRESS docker-compose.yml .env file has been set.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloripoll%2Fdocker-wordpress-6.4-php-8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabloripoll%2Fdocker-wordpress-6.4-php-8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloripoll%2Fdocker-wordpress-6.4-php-8/lists"}