mirror of
https://github.com/Haxxnet/Compose-Examples.git
synced 2026-11-15 16:32:27 +01:00
Enhance PHP service configuration in docker-compose
CI / validateComposeSyntax (push) Successful in 25s
CI / validateComposeSyntax (push) Successful in 25s
Added user, security options, and resource limits to PHP service.
This commit is contained in:
1 file changed
+15
@@ -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:
|
||||||
Reference in new issue
Block a user