build(docker): optimize image size and security

- add mysql client binaries for database operations
- reduce php extensions to production essentials
- bind mysql and phpmyadmin to localhost only
- replace php-fpm.conf with php.ini for upload limits
This commit is contained in:
2026-03-21 03:39:34 +03:00
parent 7b6ed48812
commit 280e8354f1
4 changed files with 18 additions and 9 deletions

View File

@@ -26,11 +26,10 @@ services:
volumes:
- ./:/var/www
mysql:
image: mysql:8.0
ports:
- "${DB_PORT:-3306}:3306"
- "127.0.0.1:${DB_PORT:-3306}:3306"
environment:
- MYSQL_DATABASE=${DB_DATABASE}
- MYSQL_USER=${DB_USERNAME}
@@ -44,9 +43,11 @@ services:
image: phpmyadmin:latest
restart: unless-stopped
ports:
- "8080:80"
- "127.0.0.1:8080:80"
environment:
- PMA_HOST=mysql
- PMA_USER=root
- PMA_PASSWORD=${DB_ROOT_PASSWORD}
- PMA_PORT=${DB_PORT:-3306}
- UPLOAD_LIMIT=100M
depends_on: