/
Dockerfile
58 lines (43 loc) · 1.73 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
FROM php:7.1.5-apache
MAINTAINER Igor Chepurnoi <chepurnoi.igor@gmail.com>
ARG HOST_UID=1000
VOLUME ["/var/www/html"]
ENV DEBIAN_FRONTEND noninteractive
RUN echo America/New_York > /etc/timezone && \
dpkg-reconfigure -f noninteractive tzdata
RUN apt-get update && apt-get install -y apt-utils && apt-get install -y \
zlib1g-dev \
libicu-dev \
libpq-dev \
git \
nano \
zip \
libfreetype6-dev \
libjpeg62-turbo-dev \
libmcrypt-dev \
libpng12-dev \
supervisor \
cron \
&& docker-php-ext-install -j$(nproc) iconv mcrypt \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& docker-php-ext-install intl zip pdo_mysql
COPY ./.bashrc /root/.bashrc
COPY ./apache.conf /etc/apache2/sites-available/000-default.conf
COPY ./php.ini /usr/local/etc/php/
RUN echo "LogFormat \"%a %l %u %t \\\"%r\\\" %>s %O \\\"%{User-Agent}i\\\"\" mainlog" >> /etc/apache2/apache2.conf
RUN a2enmod rewrite remoteip
RUN set -x && curl -sS https://getcomposer.org/installer | php \
&& mv composer.phar /usr/local/bin/composer \
&& composer global require "fxp/composer-asset-plugin:^1.2.0" \
&& composer global require hirak/prestissimo --prefer-dist --no-interaction
RUN usermod -u ${HOST_UID} www-data && groupmod -g ${HOST_UID} www-data && chsh -s /bin/bash www-data
RUN cp /root/.bashrc /var/www
# setup cron
ADD ./crontab /etc/cron.d/cron-jobs
RUN chmod 0644 /etc/cron.d/cron-jobs && touch /var/log/cron.log
# setup supervisor
RUN mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
EXPOSE 80
CMD ["/usr/bin/supervisord"]