dockerized-php/docker/php/Dockerfile

27 lines
583 B
Docker
Executable File

# Base image
FROM php:8.3-fpm-alpine
# Install required extensions
RUN docker-php-ext-install pdo pdo_mysql bcmath
# Install Composer
COPY --from=composer:2.7 /usr/bin/composer /usr/bin/composer
# Set working directory
WORKDIR /var/www/html
# Copy app files
COPY . /var/www/html
# Ensure entrypoint script is
RUN chmod +x /var/www/html/docker/php/entrypoint.sh
# Set permissions for app files
RUN chown -R www-data:www-data /var/www/html
# Expose PHP-FPM port
EXPOSE 9000
# Start PHP-FPM (Handled in entrypoint.sh)
CMD ["sh", "-c", "/var/www/html/docker/php/entrypoint.sh"]