Files
MKM/Dockerfile
Jp 8e3913bda8 fix(Dockerfile): replace php extension installer with docker-php-ext-install
The third-party extension installer (mlocati/docker-php-extension-installer) was causing tar permission issues on the remote server. Using the standard `docker-php-ext-install` method resolves this compatibility problem.
2026-02-26 11:44:16 +08:00

41 lines
1.0 KiB
Docker

FROM php:8.4-fpm
# Set working directory early to avoid conflicts with host files
WORKDIR /var/www
# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libpng-dev \
libonig-dev \
libxml2-dev \
zip \
unzip \
libzip-dev \
libicu-dev
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
# Install PHP extensions using standard method to avoid tar permission issues on remote server
RUN docker-php-ext-install pdo_mysql mbstring exif pcntl bcmath gd zip intl
# Get latest Composer
COPY --from=docker.io/library/composer:latest /usr/bin/composer /usr/bin/composer
# Copy application files and fix permissions
COPY . /var/www
RUN chown -R www-data:www-data /var/www && \
find /var/www -type d -exec chmod 755 {} + && \
find /var/www -type f -exec chmod 644 {} + && \
rm -rf /var/www/.circleci /var/www/.github
# Change current user to www
USER www-data
# Expose port 8000
EXPOSE 8000
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]