-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile
64 lines (48 loc) · 2.23 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
FROM ubuntu:12.04
MAINTAINER Luis Elizondo "[email protected]"
ENV DEBIAN_FRONTEND noninteractive
# Ensure UTF-8
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
# Deny restarting applications when installing them
RUN echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d
# Update system
RUN apt-get update && apt-get dist-upgrade -y
# Install apache, PHP, and supplimentary programs. curl and lynx-cur are for debugging the container.
RUN apt-get -y install apache2 libapache2-mod-php5 php5-mcrypt php5-cli php5-common php5-json php5-memcache php5-mysql php5-gd php-pear php-apc php5-dev php5-curl curl git supervisor make
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN pecl install uploadprogress
RUN /usr/bin/curl -sS https://getcomposer.org/installer | /usr/bin/php
RUN /bin/mv composer.phar /usr/local/bin/composer
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install Composer and Drush
RUN /usr/local/bin/composer self-update
RUN /usr/local/bin/composer global require drush/drush:6.*
RUN ln -s /.composer/vendor/drush/drush/drush /usr/local/bin/drush
# Enable apache mods.
RUN a2enmod php5
RUN a2enmod rewrite
# PHP
RUN sed -i 's/memory_limit = .*/memory_limit = 196M/' /etc/php5/apache2/php.ini
RUN sed -i 's/cgi.fix_pathinfo = .*/cgi.fix_pathinfo = 0/' /etc/php5/apache2/php.ini
RUN sed -i 's/upload_max_filesize = .*/upload_max_filesize = 500M/' /etc/php5/apache2/php.ini
RUN sed -i 's/post_max_size = .*/post_max_size = 500M/' /etc/php5/apache2/php.ini
RUN echo "extension=uploadprogress.so" > /etc/php5/conf.d/uploadprogress.ini
# Manually set up the apache environment variables
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/supervisor
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
RUN usermod -u 1000 www-data
RUN usermod -a -G users www-data
RUN chown -R www-data:www-data /var/www
EXPOSE 80
WORKDIR /var/www
VOLUME ["/var/www/sites/default/files"]
CMD ["/usr/bin/supervisord", "-n"]
# Add files
ADD ./config/supervisord-apache.conf /etc/supervisor/conf.d/supervisord-apache.conf
ADD ./config/apache-config.conf /etc/apache2/sites-enabled/000-default