{"id":19281243,"url":"https://github.com/zouloux/docker-debian-apache-php","last_synced_at":"2025-07-07T21:38:40.050Z","repository":{"id":106856321,"uuid":"385884569","full_name":"zouloux/docker-debian-apache-php","owner":"zouloux","description":"DDAP image based on Debian, with Apache 2.4, and PHP (7.2 to 8.3).","archived":false,"fork":false,"pushed_at":"2024-11-04T13:39:02.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-05T16:45:45.976Z","etag":null,"topics":[],"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/zouloux.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":"2021-07-14T09:29:50.000Z","updated_at":"2024-11-04T13:39:06.000Z","dependencies_parsed_at":"2024-11-04T14:27:57.301Z","dependency_job_id":"aa0d9213-bb83-4239-b12e-bb72cda0714c","html_url":"https://github.com/zouloux/docker-debian-apache-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/zouloux%2Fdocker-debian-apache-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Fdocker-debian-apache-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Fdocker-debian-apache-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zouloux%2Fdocker-debian-apache-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zouloux","download_url":"https://codeload.github.com/zouloux/docker-debian-apache-php/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240385725,"owners_count":19793062,"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":[],"created_at":"2024-11-09T21:22:07.235Z","updated_at":"2025-07-07T21:38:40.043Z","avatar_url":"https://github.com/zouloux.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"**TLDR** : [docker-compose.example.yaml](docker-compose.example.yaml)\n\n# Docker Debian Apache PHP\n\n**DDAP** is a docker image based on Debian, with **Apache 2.4**, and **PHP** (from 7.2 to 8.4).\n\nAvailable on [Docker Hub](https://hub.docker.com/repository/docker/zouloux/docker-debian-apache-php)\n\n\u003e Latest push is 15th April 2025 ( 7.2 / 7.3 / 7.4 / 8.0 / 8.1 / 8.2 / 8.3 / 8.4 ) \n\u003e Please note that obsolete PHP versions **7.X** are not pushed frequently but can be built locally on your project.\n\nThis image is built for `linux/amd64` (x86_64) and `linux/arm64` (aarch64 / Apple Silicon)\nFeel free to extend this image and adapt it to your needs or use it directly for your web projects.\n\n\u003e **New** : this image is now from debian-slim, and not from PHP:X-apache anymore.\n\u003e It's way slimmer and faster to build. See [./v1](v1) for previous source code.\n\n\u003e This image is missing MySQL or any Database on purpose.\n[Compose with a Mysql or Maria image to add this feature.](#compose-mysql-image)\n\n## Installed extensions\n\n### APT Modules\n\n- all modules installed by default with Debian 11 slim\n- gnupg2\n- curl\n- git\n- sendmail\n- zip / unzip\n\n### Other utilities\n\n- `composer` ( v2 )\n\n### PHP extensions\n\n- opcache / apcu / memcached\n- mysqli / mysql / pdo / pdo-mysql / pdo-sqlite\n- zip / bz2\n- gd / intl / tokenizer / mcrypt / mbstring\n- dom / zimplexml / xml\n- curl\n\n\n\u003e mcrypt is only installed prior to `8.2`, this package being deprecated now.\n\n### PHP\n\nPHP is working in FPM mode which means that a PHP service is running. \n\n### Apache multi threading\n\n\u003e `sleep.php` is available in example to check that blocking scripts now works with other requests.\n\n## Usage\n\nCommon usage is to use an already built image from Docker Hub :\n\n### Specify PHP version\n\n```yaml\nservices:\n  ddap :\n    # Example, we need the legacy PHP 7.4 for a rusty project\n    image: zouloux/docker-debian-apache-php:v2-php7.4\n    volumes:\n      - './public:/var/www/html'\n```\n\n\u003e Available versions are `v2-php7.2` / `v2-php7.3` / `v2-php7.4` / `v2-php8.0` / `v2-php8.1` / `v2-php8.2` / `v2-php8.3`\n\n\u003e Web root is in `/var/www/html` by default and can be changed with `DDAP_PUBLIC_PATH`\n\n### Map volumes\n\n- `/var/www` is user's root and current directory. Can be used to run processes outside `/html` directory ( ex `composer install` )\n- `/var/www/html` is root published directory by Apache ( http requests starts here ).\n\n```yaml\nservices:\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    volumes:\n      - './:/var/www'\n      - './public:/var/www/html'\n```\n\n### Change webroot path\n\n```yaml\nservices:\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    volumes:\n      - './public:/var/www/public'\n    environment:\n      DDAP_PUBLIC_PATH: '/var/www/public'\n```\n\n### Change base\n\nDefault base is `/`, and can be changed to a sub-directory.\nIt means that all request will have to be from the base to go to the webroot.\nThis can be handy in some case when Apache is running behind a reverse-proxy under a specific path.\n\n\n```yaml\nservices:\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    volumes:\n      - './public:/var/www/html'\n    environment:\n      DDAP_BASE: '/backend'\n```\n\n\u003e `http://localhost/backend/test.html` will target `/var/www/html/test.html`\n\n\u003e All requests that are not in `/backend` will be refused \n\n\n### Enable apache login / password for public directory\n\nThis HTTP password will be required on all `/var/www/html` directory.\n\n```yaml\nversion: \"3.7\"\nservices:\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    environment:\n      DDAP_LOGIN: admin\n      DDAP_PASSWORD: secret\n    volumes:\n      - './public:/var/www/html'\n```\n\n### Dev tools\n\nSome devtools can be installed. `http://docker-host/devtools` folder will be available if enabled.\nSee [/devtools](https://github.com/zouloux/docker-debian-apache-php/tree/main/devtools) directory.\n\nAvailable devtools :\n- apcu cache monitor\n- phpinfo\n\n```yaml\nversion: \"3.7\"\nservices:\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    environment:\n      DDAP_DEVTOOLS: 'true'\n    volumes:\n      - './public:/var/www/html'\n```\n\n\u003e You can change the `/devtools` URL with the `DDAP_DEVTOOLS_URL` env. \n\n\u003e Add your own tools by mapping the `/devtools` directory\n\n\n### Use dot env file\n\nA `dotenv` file can also be used for convenience.\n\n```yaml\nversion: \"3.7\"\nservices:\n  ddap :\n    build:\n      context: deploy/docker-debian-apache-php\n      args:\n        IMAGE_PHP_VERSION: ${PHP_VERSION:-}\n    environment:\n      DDAP_LOGIN: ${DDAP_LOGIN:-}\n      DDAP_PASSWORD: ${DDAP_PASSWORD:-}\n      DDAP_DEVTOOLS: ${DDAP_DEVTOOLS:-}\n      DDAP_DEVTOOLS_URL: ${DDAP_DEVTOOLS_URL:-}\n    volumes:\n      - './public:/var/www/html'\n```\n\n`.env` file :\n```dotenv\nPHP_VERSION=8.2\nDDAP_LOGIN=admin\nDDAP_PASSWORD=secret\nDDAP_DEVTOOLS=true\nDDAP_DEVTOOLS_URL=/admin/devtools\n```\n\n### Customize PHP config\n\nYou can override some PHP config with envs.\nHere is an override example with default values :\n\n```yaml\nservices:\n  ddap :\n    environment:\n      DDAP_PHP_DISPLAY_ERRORS: \"false\"\n      DDAP_PHP_TIMEZONE: \"UTC\"\n      DDAP_PHP_MEMORY_LIMIT: \"256M\"\n      DDAP_PHP_MAX_EXECUTION_TIME: \"30\"\n      DDAP_PHP_UPLOAD_SIZE: \"128M\"\n```\n\n### Custom PHP config file\n\nTo use custom config files for apache or php,\nSimply create your `config/php.ini` for ex, and map specific config file with `volumes`.\nDefault configs are [available here](https://github.com/zouloux/docker-debian-apache-php/tree/main/config). \n\n```yaml\nversion: \"3.7\"\nservices:\n  ddap:\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    environment:\n      DDAP_LOGIN: ${DDAP_LOGIN:-}\n      DDAP_PASSWORD: ${DDAP_PASSWORD:-}\n      DDAP_DEVTOOLS: ${DDAP_DEVTOOLS:-}\n    volumes:\n      - './public:/var/www/html'\n      - './config/php.ini:/config/php.ini'\n```\n\n\u003e `DDAP_PHP_*` envs will not work anymore with a custom `php.ini` file.\n\n### Compose with MySQL\n\nThis image is missing MySQL image on purpose. To add a MySQL server to your stack :\n\n```yaml\nversion: \"3.7\"\nservices:\n\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    volumes:\n      - './public:/var/www/html'\n\n  maria:\n    image: mariadb\n    restart: unless-stopped\n    container_name: maria\n    hostname: maria\n    ports:\n      - '3306:3306'\n    environment:\n      MYSQL_ROOT_PASSWORD: \"${MYSQL_ROOT_PASSWORD:-}\"\n    volumes :\n      - './data/mysql:/var/lib/mysql:delegated'\n\n  phpmyadmin:\n    image: phpmyadmin\n    restart: unless-stopped\n    container_name: phpmyadmin\n    environment:\n      PMA_HOST: \"maria\"\n```\n\n### Crontab\n\nTrigger crontabs with env `DDAP_CRON_TASK`\n\n```yaml\nservices:\n  ddap :\n    image: zouloux/docker-debian-apache-php:v2-php8.3\n    volumes:\n      - './public:/var/www/html'\n    environment:\n      DDAP_PORT: 7000\n      DDAP_CRON_TASK: \"* * * * * curl http://localhost:7000/cron.php\"\n```\n\n\u003e This will trigger cron.php every minute. Please note the used port for internal querying.\n\n```php\n\u003c?php\nerror_log(\"Cron curl tab received \".time());\necho \"ok\";\n```\n\n---\n\n## Advanced usage\n\n### Test this image or work on it \n\n- `git clone https://github.com/zouloux/docker-debian-apache-php.git`\n- `cd docker-debian-apache-php/test`\n- `docker-compose build`\n- `docker-compose up`\n- Then go to localhost:8080\n\n### Build it locally\n\nIf you need to customize this image locally, you still can specify the PHP version.\nUse `args` to specify current php version. Non tested PHP version may work.\nDocker image needs to be rebuilt if `args` are changed, with `docker-compose build`.\n\n```yaml\nversion: \"3.7\"\nservices:\n  ddap :\n    build:\n      context: path/to/docker-debian-apache-php/trunk\n      args:\n        IMAGE_PHP_VERSION: 8.2\n    volumes:\n      - './:/root'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouloux%2Fdocker-debian-apache-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzouloux%2Fdocker-debian-apache-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzouloux%2Fdocker-debian-apache-php/lists"}