unioil-mobile-api/docker/php/Dockerfile

34 lines
833 B
Docker

# Base image
FROM php:8.3-fpm-alpine
# Install required dependencies for PHP extensions and GD
RUN apk update && apk add --no-cache \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd zip \
&& docker-php-ext-install pdo_mysql
# 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 executable
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"]