-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile-73
127 lines (106 loc) · 3.93 KB
/
Dockerfile-73
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
ARG PHP_VERSION=7.3-fpm
FROM php:${PHP_VERSION}
RUN apt-get update && apt-get install -y \
zlib1g-dev \
libjpeg-dev\
libpng-dev\
libfreetype6-dev \
libpq-dev \
libicu-dev g++ \
libxml2-dev \
mariadb-client \
crudini \
fcgiwrap \
libzip-dev
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
RUN docker-php-ext-install pdo pdo_mysql zip gd intl mbstring bcmath sockets iconv mysqli soap
# PHP VARIABLES
ENV PHP_GLOBAL_PATH="/usr/local/etc/php/"
ENV PHP_GLOBAL_CONFIG_PATH="${PHP_GLOBAL_PATH}conf.d/"
ENV PHP_CONFIG_PATH="/var/php/config/"
ENV PHP_FPM_CONFIG="${PHP_CONFIG_PATH}php-fpm.conf"
ENV PHP_INI_CONFIG="${PHP_CONFIG_PATH}php.ini"
ENV CONFIG_GLOBAL_XDEBUG="${PHP_GLOBAL_CONFIG_PATH}docker-php-ext-xdebug.ini"
ENV CONFIG_XDEBUG="${PHP_CONFIG_PATH}xdebug.ini"
ENV PATH_XDEBUG_PROFILE="/var/xdebug/"
ENV PHP_INI_OPCACHE="${PHP_CONFIG_PATH}opcache.ini"
# PHP PM (512 Mb memory / 60 = 8)
ENV PHP_NAME=www
ENV PHP_PM=dynamic
ENV PHP_PM_MAX_CHILDREN=8
ENV PHP_PM_START_SERVERS=2
ENV PHP_PM_MIN_SPARE_SERVERS=2
ENV PHP_PM_MAX_SPARE_SERVERS=4
ENV PHP_PM_MAX_REQUESTS=500
ENV PHP_PM_PROCESS_IDLE_TIMEOUT=300
ENV COMPOSER_INSTALL_PARAMS="-a --no-dev"
ENV CLI=false
# INSTALANDO MEMCACHED
RUN apt-get update && apt-get install -y libmemcached-dev \
&& pecl install memcached \
&& docker-php-ext-enable memcached
# INSTALANDO REDIS
RUN pecl install redis \
&& docker-php-ext-enable redis
# CONFIGURANDO TIMEZONE
RUN pecl install timezonedb \
&& echo "extension=timezonedb.so" > ${PHP_GLOBAL_CONFIG_PATH}00_timezone.ini
# CONFIGURAÇÃO PHP
COPY config/ ${PHP_CONFIG_PATH}
RUN ln -s "${PHP_GLOBAL_PATH}php.ini-production" "${PHP_GLOBAL_PATH}php.ini" \
&& ln -s "${PHP_CONFIG_PATH}php.ini" "${PHP_GLOBAL_CONFIG_PATH}00-docker-config.ini" \
&& chown -Rf www-data:www-data ${PHP_CONFIG_PATH}
# INSTALANDO APCU
RUN pecl install apcu \
&& docker-php-ext-enable apcu
# HABILITANDO OPCACHE
RUN docker-php-ext-install opcache \
&& ln -s "${PHP_CONFIG_PATH}opcache.ini" "${PHP_GLOBAL_CONFIG_PATH}00-opcache.ini"
# INSTALANDO DOCKERIZE
ENV DOCKERIZE_VERSION v0.6.1
RUN apt-get update && apt-get install -y wget \
&& wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# INSTALANDO SUDO
RUN apt-get update && apt-get install -y sudo
RUN echo "www-data:www-data" | chpasswd && adduser www-data sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV TZ=America/Fortaleza
ENV WWW=/var/www
ENV PUBLIC_HTML="${WWW}/public"
ENV SOURCE_CODE_FOLDER="/var/src"
ENV DB_PORT=3306
ENV XDEBUG_PACKAGE=xdebug
ENV IONCUBE_PHP_VERSION=7.3
ENV IONCUBE_EXT_FOLDER=no-debug-non-zts-20180731
COPY sh/ /usr/local/bin/
RUN chmod +x /usr/local/bin/install-composer \
&& chmod +x /usr/local/bin/install-ioncube \
&& chmod +x /usr/local/bin/install-xdebug \
&& chmod +x /usr/local/bin/configure-php \
&& chmod +x /usr/local/bin/fpm-status \
&& chmod +x /usr/local/bin/start \
&& chmod +x /usr/local/bin/migrate-db \
&& chmod +x /usr/local/bin/seed-db \
&& chmod +x /usr/local/bin/composer-install \
&& chmod +x /usr/local/bin/composer-config \
&& chmod +x /usr/local/bin/start-php \
&& chmod +x /usr/local/bin/exec-cmd \
&& chmod +x /usr/local/bin/entrypoint-php \
&& chmod +x /usr/local/bin/composer \
&& chmod +x /usr/local/bin/php-utils \
&& chmod +x /usr/local/bin/run-as-www \
&& chmod +x /usr/local/bin/copy-from-src \
&& chmod +x /usr/local/bin/run-event \
&& chmod +x /usr/local/bin/start-php-fpm \
&& chmod +x /usr/local/bin/entrypoint-cli
COPY www73/public/info.php $PUBLIC_HTML/index.php
RUN chown www-data:www-data /var/www/
RUN chown www-data:www-data $PUBLIC_HTML
RUN rm -rf /var/lib/apt/lists/*
WORKDIR $PUBLIC_HTML
EXPOSE 9000
STOPSIGNAL SIGQUIT
ENTRYPOINT ["entrypoint-php"]
CMD ["php-fpm"]