perf: php-fpm + nginx sur Alpine (547MB -> 93MB)#72
Merged
Conversation
…93MB) Aucune RewriteRule/RewriteCond dans le repo. La seule fonctionnalité Apache utilisée est le Basic Auth de Calendar/ADMIN/ (.htaccess) — équivalent nginx direct (auth_basic), même format .htpasswd, apache2-utils reste installé (nom de paquet identique sur Alpine) pour htpasswd toujours appelé par docker-entrypoint.sh. Point d'attention traité avec soin : chez nginx, un bloc "location ~ \.php$" générique est prioritaire sur un "location /Calendar/ADMIN/" simple pour les requêtes .php (les locations regex passent avant les préfixes simples) — sans précaution, l'auth aurait pu être contournée pour les fichiers .php de l'admin. Résolu avec "location ^~ /Calendar/ADMIN/" + un bloc \.php$ imbriqué qui répète explicitement auth_basic, et vérifié directement plutôt que supposé correct. Testé sur le VPS (build --no-cache + conteneur démarré réellement, CALENDAR_ADMIN_USER/PASSWORD factices) : - .htpasswd généré correctement au démarrage - / répond 200 - Calendar/data/ répond 403 (bloqué, comme avant) - Calendar/ADMIN/index.php SANS identifiants -> 401 - Calendar/ADMIN/ (répertoire) SANS identifiants -> 401 - Calendar/ADMIN/modules/gameList.php SANS identifiants -> 401 (le point sensible : confirme qu'aucun .php de l'admin n'échappe à l'auth) - Calendar/ADMIN/index.php avec MAUVAIS identifiants -> 401 - Calendar/ADMIN/index.php avec BONS identifiants -> 200 - curl_init() disponible dans le conteneur Taille de l'image : 547MB -> 93MB (-83%).
This was referenced Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Aucune
RewriteRule/RewriteConddans le repo. La seule fonctionnalité Apache utilisée est le Basic Auth deCalendar/ADMIN/(.htaccess) — équivalent nginx direct (auth_basic), même format.htpasswd.apache2-utilsreste installé (nom de paquet identique sur Alpine) pourhtpasswd, toujours appelé pardocker-entrypoint.sh.Point d'attention traité avec soin
Chez nginx, un bloc
location ~ \.php$générique est prioritaire sur unlocation /Calendar/ADMIN/simple pour les requêtes.php(les locations regex passent avant les préfixes simples) — sans précaution, l'auth aurait pu être contournée pour les fichiers.phpde l'admin. Résolu aveclocation ^~ /Calendar/ADMIN/+ un bloc\.php$imbriqué qui répète explicitementauth_basic, et vérifié directement plutôt que supposé correct (voir test plan).Mesures
Taille de l'image : 547MB -> 93MB (-83%)
Test plan
Testé sur le VPS (build
--no-cache+ conteneur démarré réellement,CALENDAR_ADMIN_USER/PASSWORDfactices) :.htpasswdgénéré correctement au démarrage/répond 200Calendar/data/répond 403 (bloqué, comme avant)Calendar/ADMIN/index.phpSANS identifiants → 401Calendar/ADMIN/(répertoire) SANS identifiants → 401Calendar/ADMIN/modules/gameList.phpSANS identifiants → 401 (le point sensible : confirme qu'aucun.phpde l'admin n'échappe à l'auth)Calendar/ADMIN/index.phpavec MAUVAIS identifiants → 401Calendar/ADMIN/index.phpavec BONS identifiants → 200curl_init()disponible dans le conteneurCloses #73