- Document --build-arg PHP_MEMORY_LIMIT option for large projects - Default is 1024M, can increase to 2048M or more as needed - Update Dockerfile version label to 0.0.1 - Add notes in both English and Japanese sections Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
40 lines
1.0 KiB
Docker
40 lines
1.0 KiB
Docker
FROM php:8.3-cli-alpine
|
|
|
|
LABEL maintainer="Security Linter Team"
|
|
LABEL description="PHP/Laravel Security Linter - Static security analysis tool"
|
|
LABEL version="0.0.1"
|
|
|
|
# Build arguments
|
|
ARG PHP_MEMORY_LIMIT=1024M
|
|
|
|
# Install composer
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /app/security-linter
|
|
|
|
# Copy composer files first for better caching
|
|
COPY composer.json composer.lock* ./
|
|
|
|
# Install dependencies
|
|
RUN composer install --no-dev --optimize-autoloader --no-interaction --no-progress
|
|
|
|
# Copy source code
|
|
COPY src/ ./src/
|
|
COPY bin/ ./bin/
|
|
COPY docs/ ./docs/
|
|
|
|
# Make binary executable, set memory limit, and create symlink
|
|
RUN chmod +x bin/security-lint \
|
|
&& echo "memory_limit=${PHP_MEMORY_LIMIT}" > /usr/local/etc/php/conf.d/memory.ini \
|
|
&& ln -s /app/security-linter/bin/security-lint /usr/local/bin/security-lint
|
|
|
|
# Default working directory for target code
|
|
WORKDIR /target
|
|
|
|
# Set entrypoint
|
|
ENTRYPOINT ["security-lint"]
|
|
|
|
# Default command (show help)
|
|
CMD ["--help"]
|