-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
69 lines (47 loc) · 2.28 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
FROM php:5.6-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 \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libxml2 \
libxml2-dev \
libcurl4-openssl-dev \
libpspell-dev \
libtidy-dev \
libgeoip-dev \
libxslt1-dev \
libicu-dev
RUN docker-php-ext-install bcmath ctype curl dom gettext hash iconv json mbstring mysqli mysql opcache posix pspell session shmop simplexml soap sockets \
tidy tokenizer wddx iconv mcrypt \
xsl zip \
pdo pdo_mysql \
xml xmlrpc xmlwriter \
exif intl
RUN docker-php-ext-configure gd --with-jpeg-dir --with-freetype-dir; \
docker-php-ext-install gd
RUN pecl install geoip && echo "extension=geoip.so" >> /usr/local/etc/php/conf.d/geoip.ini \
&& pecl install memcache && echo "extension=memcache.so" >> /usr/local/etc/php/conf.d/memcache.ini
ADD apache-security.conf /etc/apache2/conf-enabled/security.conf
RUN a2enmod rpaf rewrite headers
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 supervisord.conf /etc/supervisor/
RUN /usr/bin/ssh-keygen -A
RUN useradd -d /home/sftpdev/ -s /bin/bash -o -g 33 -u 33 sftpdev; \
usermod -d /home/sftpdev/ www-data && \
echo "sftpdev ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers; \
ln -s /var/www/html/ /home/sftpdev/ ; \
echo "www-data ALL=(ALL:ALL) NOPASSWD: ALL" >> /etc/sudoers
WORKDIR /home/sftpdev/
RUN mkdir /var/run/sshd; chmod 0755 /var/run/sshd \
&& 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
RUN sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/sshd
ADD start.sh /
CMD ["/start.sh"]