scan.fyi/Dockerfile
2026-02-22 19:02:59 +00:00

52 lines
1.3 KiB
Docker
Executable file

# Use official PHP 8.5 FPM image
FROM php:8.5-fpm
# Set working directory
WORKDIR /var/www/html
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libpq-dev \
libzip-dev \
nginx \
supervisor
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Fix nginx permissions for rootless
RUN mkdir -p /var/lib/nginx/body /var/lib/nginx/proxy /var/lib/nginx/fastcgi /var/log/nginx /var/run \
&& chmod -R 777 /var/lib/nginx /var/log/nginx /var/run
# Install PHP extensions
RUN docker-php-ext-install pdo_mysql pdo_pgsql mbstring exif pcntl bcmath gd zip
# Get latest Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Copy nginx configuration
COPY docker/nginx/default.conf /etc/nginx/sites-available/default
# Copy supervisor configuration
COPY docker/supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# Create necessary directories
RUN mkdir -p /var/www/html/storage /var/www/html/bootstrap/cache
# Set permissions
RUN chown -R www-data:www-data /var/www/html \
&& chmod -R 755 /var/www/html/storage \
&& chmod -R 755 /var/www/html/bootstrap/cache
# Expose port 80
EXPOSE 8080
# Start supervisor
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]