-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
83 lines (67 loc) · 2.53 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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM php:7.4-apache
LABEL maintainer="dl@varme.pw"
ENV TZ=Europe/Moscow
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ARG COMPOSER_VERSION="2.5.4"
ARG OLD_COMPOSER_VERSION="1.10.26"
RUN set -ex && \
apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libgmp-dev \
libwebp-dev \
libxml2-dev \
zlib1g-dev \
libncurses5-dev \
libldb-dev \
libldap2-dev \
libicu-dev \
libmemcached-dev \
libcurl4-openssl-dev \
libssl-dev \
libsqlite3-dev \
libzip-dev \
libonig-dev \
curl \
ssmtp \
wget \
git \
nano \
zip \
mariadb-client \
&& rm -rf /var/lib/apt/lists/*
RUN pecl install xdebug-3.1.1 \
&& pecl install memcached-3.1.5 \
&& pecl install redis \
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
&& docker-php-ext-configure mysqli --with-mysqli=mysqlnd \
&& docker-php-ext-configure opcache --enable-opcache \
&& docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) mysqli pdo_mysql exif pcntl intl gmp bcmath mbstring gd soap zip opcache sockets
RUN wget https://getcomposer.org/download/${COMPOSER_VERSION}/composer.phar -O /usr/local/bin/composer && \
chmod a+rx /usr/local/bin/composer
RUN wget https://getcomposer.org/download/${OLD_COMPOSER_VERSION}/composer.phar -O /usr/local/bin/composer1 && \
chmod a+rx /usr/local/bin/composer1
RUN groupadd --gid 1000 1000 && \
usermod --non-unique --uid 1000 www-data && \
usermod --gid 1000 www-data
RUN mkdir /var/www/.composer && \
mkdir /var/www/.ssh
RUN chown www-data:www-data /var/www -R && \
chown www-data:www-data /usr/local/etc/php/conf.d -R && \
chown www-data:www-data /var/www/.composer && \
chown www-data:www-data /var/www/.ssh
RUN echo 'DocumentRoot ${DOCUMENT_ROOT}' >> /etc/apache2/apache2.conf && \
echo 'ServerName ${HOST_NAME}' > /etc/apache2/conf-enabled/default.conf && \
echo 'ServerSignature Off' > /etc/apache2/conf-enabled/z-security.conf && \
echo 'ServerTokens Minimal' >> /etc/apache2/conf-enabled/z-security.conf && \
rm /etc/apache2/sites-enabled/000-default.conf
RUN a2enmod rewrite
COPY php.ini /usr/local/etc/php
COPY ssmtp.conf /etc/ssmtp/
COPY .bashrc /var/www/
COPY docker-entrypoint.sh /entrypoint.sh
WORKDIR /var/www
USER www-data:www-data
ENTRYPOINT ["/entrypoint.sh"]