{"id":23265681,"url":"https://github.com/pabloripoll/docker-php-8.3-service","last_synced_at":"2026-04-28T16:03:13.979Z","repository":{"id":224122563,"uuid":"762425234","full_name":"pabloripoll/docker-php-8.3-service","owner":"pabloripoll","description":"Alpine 3.19 image to build PHP FPM 8.3 Docker Containers","archived":false,"fork":false,"pushed_at":"2024-04-16T11:23:52.000Z","size":92,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T07:36:40.058Z","etag":null,"topics":["alpine","docker","docker-compose","dockerfile","fpm","makefile","nginx","php"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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-02-23T18:52:01.000Z","updated_at":"2025-02-08T00:50:01.000Z","dependencies_parsed_at":"2024-02-23T22:42:49.644Z","dependency_job_id":"ba158c04-59ce-41c1-ac10-6e1c0858193e","html_url":"https://github.com/pabloripoll/docker-php-8.3-service","commit_stats":null,"previous_names":["pabloripoll/docker-php-8.3"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pabloripoll/docker-php-8.3-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-php-8.3-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-php-8.3-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-php-8.3-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-php-8.3-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pabloripoll","download_url":"https://codeload.github.com/pabloripoll/docker-php-8.3-service/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pabloripoll%2Fdocker-php-8.3-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32387923,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","dockerfile","fpm","makefile","nginx","php"],"created_at":"2024-12-19T15:31:34.242Z","updated_at":"2026-04-28T16:03:13.966Z","avatar_url":"https://github.com/pabloripoll.png","language":"Makefile","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# PHP 8+ Service\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 any 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## Container Service\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 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## Dockerfile insight\n```\n# Install main packages and remove default server definition\nRUN apk add --no-cache \\\n  curl \\\n  wget \\\n  nginx \\\n  curl \\\n  zip \\\n  bash \\\n  vim \\\n  git \\\n  supervisor\n\nRUN set -xe \\\n    \u0026\u0026 apk add --no-cache --virtual .build-deps \\\n        libzip-dev \\\n        freetype-dev \\\n        icu-dev \\\n        libmcrypt-dev \\\n        libjpeg-turbo-dev \\\n        libpng-dev \\\n        libxslt-dev \\\n        patch \\\n        openssh-client\n\n# Install PHP and its extensions packages and remove default server definition\nENV PHP_V=\"php83\"\n\nRUN apk add --no-cache \\\n  ${PHP_V} \\\n  ${PHP_V}-cli \\\n  ${PHP_V}-ctype \\\n  ${PHP_V}-curl \\\n  ${PHP_V}-dom \\\n  ${PHP_V}-fileinfo \\\n  ${PHP_V}-fpm \\\n  ${PHP_V}-gd \\\n  ${PHP_V}-intl \\\n  ${PHP_V}-mbstring \\\n  ${PHP_V}-opcache \\\n  ${PHP_V}-openssl \\\n  ${PHP_V}-phar \\\n  ${PHP_V}-session \\\n  ${PHP_V}-tokenizer \\\n  ${PHP_V}-soap \\\n  ${PHP_V}-xml \\\n  ${PHP_V}-xmlreader \\\n  ${PHP_V}-xmlwriter \\\n  ${PHP_V}-simplexml \\\n  ${PHP_V}-zip \\\n  # Databases\n  ${PHP_V}-pdo \\\n  ${PHP_V}-pdo_sqlite \\\n  ${PHP_V}-sqlite3 \\\n  ${PHP_V}-pdo_mysql \\\n  ${PHP_V}-mysqlnd \\\n  ${PHP_V}-mysqli \\\n  ${PHP_V}-pdo_pgsql \\\n  ${PHP_V}-pgsql \\\n  ${PHP_V}-mongodb \\\n  ${PHP_V}-redis\n\n# PHP Docker\nRUN docker-php-ext-install pdo pdo_mysql gd\n\n# PHP PECL extensions\nRUN apk add \\\n  ${PHP_V}-pecl-amqp \\\n  ${PHP_V}-pecl-xdebug\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. Main `/docker` directory has `/nginx-php` directory separated in case of needing to be included other container service directory with its specific contents\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│   └── (other...)\n│\n├── resources\n│   ├── doc\n│   │   └── (any documentary file...)\n│   │\n│   └── project\n│       └── (any file or directory required for re-building the app...)\n│\n├── project\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  project-ssh             enters the project container shell\nMakefile  project-set             sets the project enviroment file to build the container\nMakefile  project-create          creates the project container from Docker image\nMakefile  project-start           starts the project container running\nMakefile  project-stop            stops the project container but data will not be destroyed\nMakefile  project-destroy         removes the project from Docker network destroying its data and Docker image\nMakefile  project-install         installs set version of project into container\nMakefile  project-update          updates set version of project into container\nMakefile  repo-flush              clears local git repository cache specially to update .gitignore\nMakefile  repo-commit             echoes commit helper commands\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=\"PHP PROJECT\"     # \u003c- this name will be prompt for automation commands\nPROJECT_ABBR=\"proj-php\"         # \u003c- part of the service image tag - useful if similar services are running\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=\"proj-php\"         # \u003c- container as a service name to build the service\nPROJECT_PATH=\"../project\"       # \u003c- path where application is binded from container to local\n```\n\nExacute the following command to create the [docker/.env](docker/.env) file, required for building the container\n```bash\n$ make project-set\nPROJECT 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 PROJECT container:\nPROJECT \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## Project Service\n\nIf the container is built with the pre-installed application content, by browsing to localhost with the selected port configured [http://localhost:8888/](http://localhost:8888/) will display the successfully installation welcome page.\n\nThe pre-installed application could require to update its dependencies. The following Makefile recipe will update dependencies set on `composer.json` file\n```bash\n$ make project-update\n```\n\nIf it is needed to build the container with other type of application *(like a PHP framework)*, there is a Makefile recipe to set at [docker/Makefile](docker/Makefile) all the commands needed for its installation.\n```bash\n$ make project-install\n```\n\n## Create the application container service\n\n```bash\n$ make project-create\n\nSYMFONY docker-compose.yml .env file has been set.\n\n[+] Building 67.8s (28/28) FINISHED                                       docker:default\n=\u003e [nginx-php internal] load build definition from Dockerfile                       0.0s\n =\u003e =\u003e transferring dockerfile: 2.88kB                                              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\n...\n\n[+] Running 2/2\n ⠴ Network proj-php_default  Created                                                0.4s\n ✔ Container proj-php        Started                                                0.3s\n[+] Running 1/0\n ✔ Container proj-php        Running\n```\n\n## Container Information\n\nDocker image size\n```bash\n$ sudo docker images\nREPOSITORY   TAG           IMAGE ID       CREATED         SIZE\nproject-app  proj...       373f6967199b   5 minutes ago   261MB\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         260.7MB   0B (0%)\nContainers      1         1         4B        0B (0%)\nLocal Volumes   1         0         473.2MB   473.2MB (100%)\nBuild Cache     39        0         15.06kB   15.06kB\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 project-stop\n[+] Stopping 1/1\n ✔ Container project-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 project-destroy\n\n[+] Removing 1/0\n ✔ Container project-app  Removed                                                     0.0s\n[+] Running 1/1\n ✔ Network project-app_default  Removed                                               0.4s\nUntagged: project-app:project-nginx-php\nDeleted: sha256:3c99f91a63edd857a0eaa13503c00d500fad57cf5e29ce1da3210765259c35b1\n```\n\nPruning Docker system cache\n```bash\n$ sudo docker system prune\n...\nTotal reclaimed space: 171.5MB\n```\n\nPruning Docker volume cache\n```bash\n$ sudo docker volume prune\n...\nTotal reclaimed space: 0MB\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloripoll%2Fdocker-php-8.3-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpabloripoll%2Fdocker-php-8.3-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpabloripoll%2Fdocker-php-8.3-service/lists"}