diff --git a/Dockerfile b/Dockerfile index 83b8838..36b3c99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,26 @@ -FROM docker.io/thecodingmachine/php:8.4-v4-fpm-alpine +# Using the slim version of 8.4; it's much more stable with Podman +FROM docker.io/php:8.4-fpm-alpine -# Set working directory WORKDIR /var/www +# Use the installer to get your specific extensions without the manual tar extraction +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + +RUN chmod +x /usr/local/bin/install-php-extensions && \ + install-php-extensions pdo_mysql mbstring exif pcntl bcmath gd zip intl + # Get latest Composer COPY --from=docker.io/composer:latest /usr/bin/composer /usr/bin/composer # Copy application files -# TheCodingMachine images default to user 'docker' (UID 1000) -COPY --chown=docker:docker . /var/www +COPY . /var/www -# You can likely remove the manual chmod/chown lines -# as this image handles them via environment variables if needed. +# Fix permissions for the www-data user +RUN chown -R www-data:www-data /var/www && \ + chmod -R 755 /var/www/storage /var/www/bootstrap/cache + +USER www-data EXPOSE 8000 -# Use the image's built-in entrypoint or your artisan command CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"] \ No newline at end of file