Enhance PHP service configuration in docker-compose
CI / validateComposeSyntax (push) Successful in 25s

Added user, security options, and resource limits to PHP service.
This commit is contained in:
LRVT authored and GitHub committed 2026-10-21 13:53:34 +02:00
1 parent 2aca03c21d
commit 78e712a1f4
1 file changed
+15
+15
View File
@@ -26,13 +26,24 @@ services:
php: php:
image: php:8-fpm-alpine image: php:8-fpm-alpine
user: 82:82
container_name: php container_name: php
hostname: php hostname: php
volumes: volumes:
- php_tmp:/tmp
- php_run:/run
- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nginx/www-data:/var/www # must be same path to www-data as above - ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/nginx/www-data:/var/www # must be same path to www-data as above
#- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/php/custom-php.ini:/usr/local/etc/php/conf.d/php.ini:ro #- ${DOCKER_VOLUME_STORAGE:-/mnt/docker-volumes}/php/custom-php.ini:/usr/local/etc/php/conf.d/php.ini:ro
restart: unless-stopped restart: unless-stopped
working_dir: /var/www working_dir: /var/www
security_opt:
- no-new-privileges:true
cap_drop:
- ALL
read_only: true
pids_limit: 100
mem_limit: 512m
cpus: 1.0
expose: expose:
- 9000 - 9000
#networks: #networks:
@@ -41,3 +52,7 @@ services:
#networks: #networks:
# proxy: # proxy:
# external: true # external: true
volumes:
php_tmp:
php_run: