-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
37 lines (30 loc) · 1.35 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
FROM ubuntu:16.04
MAINTAINER Jangshant Singh <[email protected]>
ENV DEBIAN_FRONTEND noninteractive
## Install php nginx mysql supervisor drush git
RUN apt update
RUN apt install -y php-fpm php-cli php-gd php-mcrypt php-mysql php-curl && \
nginx \
curl \
supervisor \
mysql-server \
libpng12-dev libjpeg-dev libpq-dev \
drush \
git
RUN echo "mysql-server mysql-server/root_password password" | debconf-set-selections && \
echo "mysql-server mysql-server/root_password_again password" | debconf-set-selections && \
rm -rf /var/lib/apt/lists/*
## Configuration
RUN sed -i 's/^listen\s*=.*$/listen = 127.0.0.1:9000/' /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i 's/^\;error_log\s*=\s*syslog\s*$/error_log = \/var\/log\/php\/cgi.log/' /etc/php/7.0/fpm/php.ini && \
sed -i 's/^\;error_log\s*=\s*syslog\s*$/error_log = \/var\/log\/php\/cli.log/' /etc/php/7.0/cli/php.ini && \
sed -i 's/^key_buffer\s*=/key_buffer_size =/' /etc/mysql/my.cnf
COPY files/root /
WORKDIR /var/www/
VOLUME /var/www/
EXPOSE 80
RUN chown -R www-data:www-data /var/www /var/log/php
RUN if [ ! -d /var/lib/mysql/mysql ];then mysqld --initialize-insecure --user=root --datadir=/var/lib/mysql; fi
RUN chown -R mysql:mysql /var/lib/mysql && \
RUN exec /usr/bin/supervisord --nodaemon -c /etc/supervisor/supervisord.conf
#ENTRYPOINT ["/entrypoint.sh"]