Files
php-apache/8.2/Dockerfile

76 lines
1.8 KiB
Docker

FROM php:8.2-apache
# 기본 패키지
RUN set -eux; \
apt update; \
apt install -y --no-install-recommends \
vim \
unzip \
curl \
ghostscript \
libfreetype6-dev \
libicu-dev \
libjpeg-dev \
libpng-dev \
libwebp-dev \
libzip-dev \
libxml2-dev \
libmagickwand-dev \
; \
rm -rf /var/lib/apt/lists/*
# PHP extensions (카페24 환경 최대한 유사)
RUN set -eux; \
docker-php-ext-configure gd \
--with-freetype \
--with-jpeg \
--with-webp \
; \
docker-php-ext-install -j$(nproc) \
bcmath \
exif \
gd \
intl \
mysqli \
pdo_mysql \
zip \
soap \
opcache \
; \
pecl install imagick-3.7.0; \
docker-php-ext-enable imagick
# Apache 모듈
RUN a2enmod rewrite headers expires remoteip
# RemoteIP (카페24 프록시 환경 대응)
RUN { \
echo 'RemoteIPHeader X-Forwarded-For'; \
echo 'RemoteIPInternalProxy 10.0.0.0/8'; \
echo 'RemoteIPInternalProxy 172.16.0.0/12'; \
echo 'RemoteIPInternalProxy 192.168.0.0/16'; \
} > /etc/apache2/conf-available/remoteip.conf \
&& a2enconf remoteip
# PHP 기본 설정 (카페24 성향 반영)
RUN { \
echo 'upload_max_filesize=64M'; \
echo 'post_max_size=64M'; \
echo 'memory_limit=256M'; \
echo 'max_execution_time=300'; \
echo 'date.timezone=Asia/Seoul'; \
} > /usr/local/etc/php/conf.d/custom.ini
# Composer
RUN curl -sS https://getcomposer.org/installer | php \
-- --install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www/html
VOLUME /var/www/html
COPY 8.2/entrypoint.sh /usr/local/bin/
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
CMD ["apache2-foreground"]