Update dockerfile
parent
d983b83d54
commit
744130eb1a
@ -1,11 +1,53 @@
|
|||||||
FROM php:7.4-apache
|
FROM php:7.4-apache
|
||||||
COPY . /var/www/html
|
COPY . /var/www/html
|
||||||
RUN docker-php-ext-install pdo_mysql
|
RUN docker-php-ext-install pdo_mysql
|
||||||
RUN apt-get install -y --no-install-recommends \
|
|
||||||
libfreetype6-dev \
|
RUN apt-get update
|
||||||
libjpeg62-turbo-dev \
|
|
||||||
libpng-dev \
|
# 1. development packages
|
||||||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
RUN apt-get install -y \
|
||||||
--with-png-dir=/usr/include/ --enable-gd-native-ttf \
|
git \
|
||||||
&& docker-php-ext-install -j$(nproc) gd
|
zip \
|
||||||
|
curl \
|
||||||
|
sudo \
|
||||||
|
nano \
|
||||||
|
unzip \
|
||||||
|
libicu-dev \
|
||||||
|
libbz2-dev \
|
||||||
|
libpng-dev \
|
||||||
|
libjpeg-dev \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libreadline-dev \
|
||||||
|
libfreetype6-dev \
|
||||||
|
g++
|
||||||
|
|
||||||
|
# 2. apache configs + document root
|
||||||
|
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
|
||||||
|
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf
|
||||||
|
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
|
||||||
|
|
||||||
|
# 3. mod_rewrite for URL rewrite and mod_headers for .htaccess extra headers like Access-Control-Allow-Origin-
|
||||||
|
RUN a2enmod rewrite headers
|
||||||
|
|
||||||
|
# 4. start with base php config, then add extensions
|
||||||
|
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
||||||
|
|
||||||
|
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||||
|
&& docker-php-ext-install gd
|
||||||
|
|
||||||
|
RUN docker-php-ext-install \
|
||||||
|
bz2 \
|
||||||
|
intl \
|
||||||
|
iconv \
|
||||||
|
bcmath \
|
||||||
|
opcache \
|
||||||
|
calendar \
|
||||||
|
mbstring \
|
||||||
|
exif \
|
||||||
|
pdo_mysql \
|
||||||
|
zip
|
||||||
|
|
||||||
|
# 5. composer
|
||||||
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
|
||||||
|
|
||||||
CMD ["apache2ctl", "-D", "FOREGROUND"]
|
CMD ["apache2ctl", "-D", "FOREGROUND"]
|
||||||
|
Loading…
Reference in New Issue