-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
69 lines (58 loc) · 1.81 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
ARG PHP_VERSION=8.2
FROM php:${PHP_VERSION}-apache
# Configure php extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
libjpeg-dev \
libpng-dev \
libmagickwand-dev \
libmcrypt-dev \
libzip-dev \
git \
zip \
libxml2-dev \
libpq-dev \
libonig-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Imagic
RUN pecl install imagick && docker-php-ext-enable imagick
# GD
RUN bash -c "if [[ \"$PHP_VERSION\" == 7.2* ]] || [[ \"$PHP_VERSION\" == 7.3* ]]; then \
docker-php-ext-configure gd --with-gd --with-jpeg-dir; \
else \
docker-php-ext-configure gd --with-jpeg --with-freetype; \
fi"
# XMLRPC
RUN bash -c "if [[ \"$PHP_VERSION\" == 7.* ]]; then \
docker-php-ext-install xmlrpc; \
else \
pecl install channel://pecl.php.net/xmlrpc-1.0.0RC3 xmlrpc && docker-php-ext-enable xmlrpc; \
fi"
RUN docker-php-ext-install \
sockets \
mbstring \
gd \
exif \
zip \
mysqli \
pgsql \
pdo pdo_mysql pdo_pgsql \
soap \
bcmath
# Composer & Craft CLI
RUN curl --silent --show-error https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& chmod a+x /usr/local/bin/composer
ENV PATH "$PATH:~/.composer/vendor/bin"
# Apache Extensions
RUN a2enmod headers rewrite expires deflate
# Volumes
RUN usermod --non-unique --uid 1000 www-data
RUN chown -R 1000:1000 /var/www/html
VOLUME /var/www/html
RUN chmod 777 /var/www/html
# Memory limit
RUN echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini;
# Update document root
RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/sites-available/*.conf
RUN sed -ri -e 's!/var/www/html!/var/www/html/public!g' /etc/apache2/apache2.conf