File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ FROM php:8.3-cli-alpine
3838
3939LABEL org.opencontainers.image.title="PhpQuality"
4040LABEL org.opencontainers.image.description="PHP Static Code Analyzer - Metrics & Quality Reports"
41- LABEL org.opencontainers.image.version="1.4.0 "
41+ LABEL org.opencontainers.image.version="1.4.1 "
4242LABEL org.opencontainers.image.vendor="amoifr"
4343LABEL org.opencontainers.image.source="https://github.com/amoifr/PhpQuality"
4444LABEL org.opencontainers.image.authors="Pascal CESCON <pascal.cescon@gmail.com>"
@@ -59,6 +59,10 @@ RUN chmod +x /app/bin/console && \
5959ENV APP_ENV=prod
6060ENV APP_SECRET=docker-build-secret-change-in-production
6161
62+ # PHP memory limit (default: unlimited for large project analysis)
63+ # Override with: docker run -e PHP_MEMORY_LIMIT=512M ...
64+ ENV PHP_MEMORY_LIMIT=-1
65+
6266# Set entrypoint
6367COPY docker/entrypoint.sh /entrypoint.sh
6468RUN chmod +x /entrypoint.sh
Original file line number Diff line number Diff line change 66# docker run amoifr13/phpquality analyze --source=/project/src (alias)
77# docker run amoifr13/phpquality --source=/project/src (shorthand)
88
9+ # Memory limit configuration (default: unlimited for large project analysis)
10+ PHP_MEMORY_LIMIT=" ${PHP_MEMORY_LIMIT:- -1} "
11+
912# If first argument starts with -, assume it's an option for phpquality:analyze
1013if [ " ${1# -} " != " $1 " ]; then
1114 set -- phpquality:analyze " $@ "
1417# Support both old 'analyze' and new 'phpquality:analyze' commands
1518if [ " $1 " = " analyze" ]; then
1619 shift
17- exec php /app/bin/console phpquality:analyze " $@ "
20+ exec php -d memory_limit= " $PHP_MEMORY_LIMIT " /app/bin/console phpquality:analyze " $@ "
1821fi
1922
2023if [ " $1 " = " phpquality:analyze" ]; then
2124 shift
22- exec php /app/bin/console phpquality:analyze " $@ "
25+ exec php -d memory_limit= " $PHP_MEMORY_LIMIT " /app/bin/console phpquality:analyze " $@ "
2326fi
2427
2528# If first argument is a known command, run it
2629case " $1 " in
2730 list|help|about|--version|--help|-V|-h)
28- exec php /app/bin/console " $@ "
31+ exec php -d memory_limit= " $PHP_MEMORY_LIMIT " /app/bin/console " $@ "
2932 ;;
3033esac
3134
3235# Otherwise, execute the command as-is
33- exec " $@ "
36+ exec " $@ "
You can’t perform that action at this time.
0 commit comments