{"id":13439690,"url":"https://github.com/matriphe/docker-alpine-php","last_synced_at":"2025-03-20T08:31:53.559Z","repository":{"id":151699249,"uuid":"47072292","full_name":"matriphe/docker-alpine-php","owner":"matriphe","description":"PHP FPM and PHP CLI docker image based on Alpine Linux","archived":true,"fork":false,"pushed_at":"2016-10-04T15:09:12.000Z","size":17,"stargazers_count":45,"open_issues_count":2,"forks_count":29,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-08-01T03:29:47.685Z","etag":null,"topics":["alpine","alpine-php","alpine-php-fpm","docker","php","php-fpm"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matriphe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2015-11-29T17:08:07.000Z","updated_at":"2023-01-28T12:06:25.000Z","dependencies_parsed_at":"2023-04-19T19:17:35.741Z","dependency_job_id":null,"html_url":"https://github.com/matriphe/docker-alpine-php","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Fdocker-alpine-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Fdocker-alpine-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Fdocker-alpine-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matriphe%2Fdocker-alpine-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matriphe","download_url":"https://codeload.github.com/matriphe/docker-alpine-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221739740,"owners_count":16872781,"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","alpine-php","alpine-php-fpm","docker","php","php-fpm"],"created_at":"2024-07-31T03:01:16.281Z","updated_at":"2024-10-27T22:31:36.646Z","avatar_url":"https://github.com/matriphe.png","language":null,"readme":"# Alpine PHP\n\n[![Build Status](https://travis-ci.org/matriphe/docker-alpine-php.svg?branch=master)](https://travis-ci.org/matriphe/docker-alpine-php)\n\nThis PHP FPM and PHP CLI docker image based on [Alpine](https://hub.docker.com/_/alpine/). Alpine is based on [Alpine Linux](http://www.alpinelinux.org), lightweight Linux distribution based on [BusyBox](https://hub.docker.com/_/busybox/). The size of the image is very small, less than 50 MB!\n\n## Tags\n\nVersions and tags are based on PHP versions.\n\nHere are the supported tags and respective Dockerfile links.\n\n * `cli`, `cli-5.6` [(Dockerfile)](https://github.com/matriphe/docker-alpine-php/blob/master/5.6/CLI/Dockerfile)\n * `fpm`, `fpm-5.6` [(Dockerfile)](https://github.com/matriphe/docker-alpine-php/blob/master/5.6/FPM/Dockerfile)\n * `fpm7`, `fpm-7` [(Dockerfile)](https://github.com/matriphe/docker-alpine-php/blob/master/7.0/FPM/Dockerfile)\n \nThe `cli` tag show that the PHP is used for command line and the `fpm` is designed to be used with PHP-FPM. It is fit with [Alpine-Nginx](https://hub.docker.com/r/matriphe/alpine-nginx/) docker image.\n\n### PHP 7.0\n\nPHP 7.0 is still using [**edge/testing** repository for PHP7 packages](https://pkgs.alpinelinux.org/packages?name=php7*\u0026branch=\u0026repo=testing\u0026arch=\u0026maintainer=). PHP 7.0 CLI is not available yet, since there's no `php7-cli` package in the repository.\n\n## Getting The Image\n\nThis image is published in the [Docker Hub](https://hub.docker.com/r/matriphe/alpine-php/). Simply run this command below to get it to your machine.\n\n```Shell\ndocker pull matriphe/alpine-php:fpm\n```\n\nOr if you want to use `cli` image. \n\n```Shell\ndocker pull matriphe/alpine-php:cli\n```\n\nAlternatively you can clone this repository and build the image using the `docker build` command.\n\n## Build\n\nThis image use `Asia/Jakarta` timezone by default. You can change the timezone by change the `TIMEZONE` environment on `Dockerfile` and then build.\n\n```Shell\ndocker build -t repository/imagename:tag .\n```\n\n## Configuration\n\nThe site data, config, and log data is configured to be located in a Docker volume so that it is persistent and can be shared by other containers or a backup container).\n\nThere is volume defined in this image `/www` that is shared with Nginx container. Please make sure both containers can access the directory. You can store the sites data to this directory.\n\n### PHP Configuration\n\nThe config is set using environments listed below on build.\n\n```Ini\nENV TIMEZONE Asia/Jakarta\nENV PHP_MEMORY_LIMIT 512M\nENV MAX_UPLOAD 50M\nENV PHP_MAX_FILE_UPLOAD 200\nENV PHP_MAX_POST 100M\n```\n\nChange it in `Dockerfile` and you can rebuild your image.\n\n## Run The Container\n\n### Create and Run The Container\n\n```Shell\ndocker run -p 9000:9000 --name phpfpm -v /home/user/public_html:/www:rw -d matriphe/alpine-php:fpm\n```\n\nIf you run and want to link Nginx container, make sure you created and run this PHP-FPM the container before running this Nginx container. Make sure the `/www` volume in PHP-FPM container is mapped.\n\n * The first `-p` argument maps the container's port 9000 to port 9000 on the host and used for communication between Nginx and PHP-FPM.\n * `--name` argument sets the name of the container, useful when starting and stopping the container.\n * The `-v` argument maps the `/home/user/public_html` directory in the host to `/www` in the container with read/write access (rw).\n * `-d` argument runs the container as a daemon.\n \n### Stopping The Container\n\n```Shell\ndocker stop phpfpm\n```\n### Start The Container Again\n\n```Shell\ndocker start phpfpm\n```\n\n## PHP CLI\n\nTo ease the job, make alias for PHP-CLI. Add this line to `~/.bashrc` so we can call it as regular `php` command.\n\n```Shell\nalias php='docker run --rm --name=php-cli -v $(pwd):/www matriphe/alpine-php:cli php'\n```","funding_links":[],"categories":["Others","Unknow"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatriphe%2Fdocker-alpine-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatriphe%2Fdocker-alpine-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatriphe%2Fdocker-alpine-php/lists"}