PHP image for personal projects
2.4K
Based on https://hub.docker.com/_/php/
Using:
Changelog: *
PHP-FPM based containers, adding PHP extensions that we often use:
Support for locales:
Enabled default PHP extensions:
Used for apps that have no separated front-end (like react), we have added nodejs so these can also be build inside the same container:
version: '3'
services:
web:
image: jurriaanr/apache:2.4-fpm
restart: always
network_mode: "bridge"
environment:
- "VIRTUAL_HOST=${DOCKER_VHOST}"
links:
- php
depends_on:
- php
volumes:
- .:/app/:cached
php:
image: jurriaanr/php:8.3-fpm
restart: always
network_mode: "bridge"
volumes:
- .:/app/:cached
environment:
- "PHP_SESSION_SAVE_HANDLER=redis"
- "PHP_SESSION_SAVE_PATH=tcp://redis:6379"
links:
- redis
depends_on:
- redis
redis:
image: redis:alpine
restart: always
network_mode: "bridge"
These values can be overwritten in your .env or "environment"-tag in your docker-compose.yml:
PHP_MAX_EXECUTION_TIME=120
PHP_MEMORY_LIMIT=256M
PHP_UPLOAD_LIMIT=8M
PHP_OPCACHE_LIMIT=64M
PHP_OPCACHE_REVALIDATE=2
PHP_SESSION_SAVE_HANDLER=files
PHP_SESSION_SAVE_PATH=""
PHP_SMTP_HOST=localhost
PHP_MAX_INPUT_VARS=1000
For example, you can add a redis container and change the redis-settings in your PHP-container:
version: '3'
services:
php:
image: jurriaanr/php:8.3-fpm
network_mode: "bridge"
environment:
- "PHP_SESSION_SAVE_HANDLER=redis"
- "PHP_SESSION_SAVE_PATH=tcp://redis:6379"
links:
- redis
depends_on:
- redis
redis:
image: redis:alpine
network_mode: "bridge"
For development, set PHP_OPCACHE_REVALIDATE to "0", the default value "2" is somewhat of a tradeoff.
Content type
Image
Digest
sha256:475924c85…
Size
468.4 MB
Last updated
26 days ago
docker pull jurriaanr/php