-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
131 lines (92 loc) · 4.6 KB
/
Dockerfile
File metadata and controls
131 lines (92 loc) · 4.6 KB
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
FROM php:7.0-apache
RUN apt-get update && \
apt-get install -y wget nginx supervisor libapache2-mod-rpaf sudo git mc net-tools openssh-server mysql-client vim nano msmtp \
cron gcc make libjpeg-dev libpng-dev libtiff-dev libvpx-dev libxpm-dev libfontconfig1-dev libxpm-dev checkinstall \
libicu-dev \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libxml2 \
libxml2-dev \
libcurl4-openssl-dev \
libpspell-dev \
libtidy-dev \
libgeoip-dev \
libxslt1-dev
WORKDIR /usr/src
#RUN apt-get install wget -y
RUN wget https://github.com/libgd/libgd/releases/download/gd-2.1.1/libgd-2.1.1.tar.gz
RUN tar zxvf libgd-2.1.1.tar.gz
WORKDIR /usr/src/libgd-2.1.1
RUN ./configure
RUN make
RUN checkinstall --pkgname=libgd3
RUN { \
echo 'opcache.memory_consumption=128'; \
echo 'opcache.interned_strings_buffer=8'; \
echo 'opcache.max_accelerated_files=4000'; \
echo 'opcache.revalidate_freq=60'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.enable_cli=1'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini
ENV PHANTOMJS phantomjs-2.1.1-linux-x86_64
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libmcrypt-dev zlib1g-dev git libgmp-dev \
libfreetype6-dev libjpeg62-turbo-dev libpng12-dev \
build-essential chrpath libssl-dev libxft-dev \
libfreetype6 libfontconfig1 libfontconfig1-dev \
&& ln -s /usr/include/x86_64-linux-gnu/gmp.h /usr/local/include/ \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-configure gmp \
&& docker-php-ext-install iconv mcrypt mbstring pdo pdo_mysql zip gd gmp opcache \
&& curl -o ${PHANTOMJS}.tar.bz2 -SL https://bitbucket.org/ariya/phantomjs/downloads/${PHANTOMJS}.tar.bz2 \
&& tar xvjf ${PHANTOMJS}.tar.bz2 \
&& rm ${PHANTOMJS}.tar.bz2 \
&& mv ${PHANTOMJS} /usr/local/share \
&& ln -sf /usr/local/share/${PHANTOMJS}/bin/phantomjs /usr/local/bin \
&& rm -rf /var/lib/apt/lists/*
ENV PHANTOMJS_BIN_PATH /usr/local/bin/phantomjs
RUN docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-gd=/usr/src/libgd-2.1.1/src/ \
&& docker-php-ext-install gd \
&& ln -s /usr/local/lib/libgd.so.3 /usr/lib/x86_64-linux-gnu/libgd.so.3
RUN docker-php-ext-install iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-gd=/usr/src/libgd-2.1.1/src/ \
&& docker-php-ext-install gd
RUN docker-php-ext-install bcmath ctype curl dom gettext hash iconv json mbstring mysqli opcache posix pspell session shmop simplexml soap sockets tidy tokenizer wddx xsl zip pdo pdo_mysql xml xmlrpc xmlwriter exif intl xdebug
#RUN pecl install memcache && echo "extension=memcache.so" >> /usr/local/etc/php/conf.d/memcache.ini
RUN pecl install geoip-1.1.1 && echo "extension=geoip.so" >> /usr/local/etc/php/conf.d/geoip.ini
RUN a2enmod rpaf rewrite
RUN echo "RPAFenable On" > /etc/apache2/conf-enabled/remoteip.conf; \
echo "RPAFproxy_ips 127.0.0.1 172.17.0.1" >> /etc/apache2/conf-enabled/remoteip.conf
ADD apache-security.conf /etc/apache2/conf-enabled/security.conf
ADD supervisord.conf /etc/supervisor/
#RUN /usr/bin/ssh-keygen -A
RUN useradd -m -d /home/sftpdev/ -s /bin/bash -o -g 33 -u 33 sftpdev; \
echo "sftpdev ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers; \
echo "www-data ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN ln -s /var/www/html /home/sftpdev/html -f
RUN mkdir /var/run/sshd; chmod 0755 /var/run/sshd
RUN sed -i "s/Listen 80/Listen 81/g" /etc/apache2/ports.conf
RUN rm -rf /etc/apache2/sites-enabled/*
ADD apache-default-vhost.conf /etc/apache2/sites-enabled/
ADD nginx.conf /etc/nginx/
RUN echo "DOCKER PHP_VERSION=$PHP_VERSION; BUILD DATE: `date -I`" > /etc/motd
RUN echo 'sendmail_path = "/usr/bin/msmtp -C /var/www/.msmtprc -t"' > /usr/local/etc/php/conf.d/sendmail-msmtp.ini
WORKDIR /home/sftpdev
ADD start.sh /
CMD ["/start.sh"]
#COMPOSER
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN chown 33:33 /var/www/
#CLEAN
RUN apt-get remove -y gcc make libjpeg-dev libpng-dev libtiff-dev libvpx-dev libxpm-dev libfontconfig1-dev libxpm-dev checkinstall libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
libxml2-dev \
libcurl4-openssl-dev \
libpspell-dev \
libtidy-dev \
libxslt1-dev