forked from edse/ubuntu-nginx-mysql-php-nodejs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (45 loc) · 1.98 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 ubuntu:14.04
MAINTAINER Emerson Estrella <emerson.estrella@gmail.com>
RUN DEBIAN_FRONTEND=noninteractive
# Update apt-get local index
RUN apt-get -qq update
# Install
RUN apt-get -y --force-yes install wget curl git unzip supervisor g++ make nginx mysql-server mysql-client redis-server php5-cli php5-fpm php5-dev php5-mysql php5-curl php5-intl php5-mcrypt php5-memcache php5-imap
RUN bash -c "wget http://getcomposer.org/composer.phar && mv composer.phar /usr/local/bin/composer && chmod +x /usr/local/bin/composer"
# PHP Redis
RUN mkdir -p /tmp/php-redis
WORKDIR /tmp/php-redis
RUN wget https://github.com/phpredis/phpredis/archive/2.2.5.zip; unzip 2.2.5.zip
WORKDIR /tmp/php-redis/phpredis-2.2.5
RUN /usr/bin/phpize; ./configure; make; make install
RUN echo "extension=redis.so" > /etc/php5/mods-available/redis.ini
RUN php5enmod redis
# MySQL conf
RUN sed -i -e"s/^bind-address\s*=\s*127.0.0.1/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
# PHP conf
RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/fpm/php.ini
RUN sed -i "s/;date.timezone =.*/date.timezone = UTC/" /etc/php5/cli/php.ini
RUN sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php5/fpm/php.ini
RUN sed -i "s/;daemonize = yes/daemonize = no/" /etc/php5/fpm/php-fpm.conf
# nginx conf
RUN echo "\ndaemon off;" >> /etc/nginx/nginx.conf
ADD files/default /etc/nginx/sites-available/default
ADD files/supervisord.conf /etc/supervisor/supervisord.conf
ADD files/php-fpm.conf /etc/php5/fpm/php-fpm.conf
ADD files/start.sh /usr/local/bin/start.sh
RUN mkdir -p /tmp/node
WORKDIR /var/multrix
RUN chown www-data:www-data /var/multrix
RUN service mysql start && service redis-server start
#xdebug
RUN apt-get -y --force-yes php5-xdebug
# Expose ports
EXPOSE 80
EXPOSE 443
# Default command for container, start supervisor
CMD ["supervisord", "--nodaemon"]
CMD ["service", "mysql", "start"]
CMD ["service", "redis-server", "start"]
CMD ["service", "php5-fpm", "start"]
CMD ["service", "nginx", "start"]
CMD ["/usr/local/bin/start.sh"]