-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.7_2
165 lines (139 loc) · 4.8 KB
/
Dockerfile.7_2
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
FROM php:7.2-fpm
MAINTAINER Stepan Yudin <[email protected]>
ENV APP_TIMEZONE=Europe/Moscow
ENV APP_DIR=/var/www/backend
# Install libs
RUN apt-get update && ACCEPT_EULA=Y apt-get install -y --no-install-recommends \
libmcrypt-dev \
zlib1g-dev \
libicu-dev g++ \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libldap2-dev \
libxml2-dev \
libcurl4-openssl-dev \
libtidy-dev \
zip \
unzip \
wget \
xvfb \
wkhtmltopdf \
default-mysql-client \
git \
mc \
ruby-full \
gnupg \
iputils-ping \
faketime \
cron \
mc \
sudo \
iputils-ping \
supervisor \
procps \
dos2unix \
tzdata \
build-essential \
openssh-client \
openssl \
libzip-dev\
libc-client-dev \
libkrb5-dev \
libldb-dev
# Install node
RUN apt-get update \
&& apt-get upgrade -y \
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs
# Install and configure PHP IMAP extension
RUN PHP_OPENSSL=yes docker-php-ext-configure imap --with-imap --with-imap-ssl --with-kerberos
RUN docker-php-ext-install imap
# Install and configure PHP Mailparse extension
RUN pecl install mailparse \
&& docker-php-ext-enable mailparse
# Install PHP mcrypt extension (for PHP <= 7.4.0)
RUN pecl install mcrypt-1.0.2
RUN docker-php-ext-enable mcrypt
# Configure PHP extensions
RUN docker-php-ext-configure intl \
&& docker-php-ext-configure pcntl \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-png-dir=/usr/include/
# Install PHP extensions
RUN docker-php-ext-install \
curl \
intl \
pcntl \
gd \
ldap \
opcache \
pdo \
pdo_mysql \
soap \
zip \
tidy \
bcmath \
sockets
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install Symfony
RUN wget https://get.symfony.com/cli/installer -O - | bash
RUN mv "$HOME"/.symfony/bin/symfony /usr/local/bin/symfony
# Initialize GIT
RUN git config --global user.email "[email protected]"
RUN git config --global user.name "www-data"
# Install PHPUnit
RUN wget https://phar.phpunit.de/phpunit-5.2.1.phar \
&& chmod +x phpunit-5.2.1.phar \
&& mv phpunit-5.2.1.phar /usr/local/bin/phpunit
# Install Codeception
RUN curl -LsS https://codeception.com/codecept.phar -o /usr/local/bin/codecept \
&& chmod a+x /usr/local/bin/codecept
# Configure PHP and FPM
COPY ./php.ini /usr/local/etc/php/
RUN sed -i 's/listen = 127.0.0.1:9000/listen = 9000/' /usr/local/etc/php-fpm.d/www.conf
# Change app and system timezone
RUN sed -i 's,\Etc/UTC,'"$APP_TIMEZONE"',' /usr/local/etc/php/php.ini
RUN cp /usr/share/zoneinfo/$APP_TIMEZONE /etc/localtime && echo $APP_TIMEZONE > /etc/timezone
# Install Supercronic
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.6/supercronic-linux-amd64 \
SUPERCRONIC=supercronic-linux-amd64 \
SUPERCRONIC_SHA1SUM=c3b78d342e5413ad39092fd3cfc083a85f5e2b75
RUN curl -fsSLO "$SUPERCRONIC_URL" \
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \
&& chmod +x "$SUPERCRONIC" \
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic
# Fix www-data permissions and create work directory
RUN usermod -a -G sudo www-data \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
&& chgrp -R www-data /var/www \
&& chmod -R g+w /var/www \
&& mkdir -p $APP_DIR \
&& chown -R www-data:www-data $APP_DIR
RUN sudo usermod -u 1000 www-data
# Install PHP MSSQL extension
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
&& curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list \
&& apt-get update && ACCEPT_EULA=Y apt-get install -y --no-install-recommends msodbcsql17 mssql-tools unixodbc-dev
RUN pecl install sqlsrv pdo_sqlsrv \
&& docker-php-ext-enable sqlsrv pdo_sqlsrv
RUN sed -i 's,^\(MinProtocol[ ]*=\).*,\1'TLSv1.0',g' /etc/ssl/openssl.cnf \
&& sed -i 's,^\(CipherString[ ]*=\).*,\1'DEFAULT@SECLEVEL=1',g' /etc/ssl/openssl.cnf
# Install MongoDB extension
RUN pecl install mongodb && echo "extension=mongodb.so" > $PHP_INI_DIR/conf.d/mongodb.ini
# Install Redis extension
RUN pecl install redis && docker-php-ext-enable redis
# Install micro text editor
RUN mkdir -p /micro && cd /micro \
&& curl https://getmic.ro | bash \
&& ln -s /micro/micro /usr/local/bin/micro
USER www-data
WORKDIR $APP_DIR
# Install dropbox uploader
RUN cd ~ && curl "https://raw.githubusercontent.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh" -o dropbox_uploader.sh \
&& chmod +x dropbox_uploader.sh \
&& touch .dropbox_uploader
# Speed up composer for www-data user
RUN composer global require hirak/prestissimo