Skip to content

Dev #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 29 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,40 @@ RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8

ENV SMTP_HOST smtp.gmail.com
ENV SMTP_PORT 587
ENV SMTP_FROMNAME My Name
ENV SMTP_USERNAME [email protected]
ENV SMTP_PASSWORD secret

# Update system
RUN apt-get update && apt-get dist-upgrade -y

# Prevent restarts when installing
RUN echo '#!/bin/sh\nexit 101' > /usr/sbin/policy-rc.d && chmod +x /usr/sbin/policy-rc.d

# Basic packages
RUN apt-get -y install php5-fpm php5-mysql php-apc php5-imagick php5-imap php5-mcrypt php5-curl php5-cli php5-gd php5-pgsql php5-sqlite php5-common php-pear curl php5-json php5-redis php5-memcache
RUN apt-get -y install nginx-extras git curl supervisor
RUN apt-get -y install msmtp msmtp-mta
# Update System & Basic packages

RUN apt-get update \
&& apt-get dist-upgrade -y \
&& apt-get -y install php5-fpm \
php5-mysql \
php-apc php5-imagick \
php5-imap \
php5-mcrypt \
php5-curl \
php5-cli \
php5-gd \
php5-pgsql \
php5-sqlite \
php5-common \
php-pear curl \
php5-json \
php5-redis \
php5-memcache \
nginx-extras \
git \
supervisor \
ca-certificates \
openssl \
sendmail --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of unnecessary files


RUN php5enmod mcrypt

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
Expand All @@ -44,38 +56,21 @@ 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"]

# Startup script
# This startup script wll configure nginx
ADD ./startup.sh /opt/startup.sh
RUN chmod +x /opt/startup.sh

ADD ./mail.sh /opt/mail.sh
RUN chmod +x /opt/mail.sh

ADD ./cron.sh /opt/cron.sh
RUN chmod +x /opt/cron.sh

# We want it empty
RUN touch /etc/msmtprc
RUN chgrp mail /etc/msmtprc
RUN chmod 660 /etc/msmtprc
RUN touch /var/log/supervisor/msmtp.log
RUN chgrp mail /var/log/supervisor/msmtp.log
RUN chmod 660 /var/log/supervisor/msmtp.log
RUN adduser www-data mail

RUN rm /usr/sbin/sendmail
RUN rm /usr/lib/sendmail

RUN ln -s /usr/bin/msmtp /usr/sbin/sendmail
RUN ln -s /usr/bin/msmtp /usr/bin/sendmail
RUN ln -s /usr/bin/msmtp /usr/lib/sendmail

RUN mkdir -p /var/cache/nginx/microcache

# Avoid sendmail starting as a service
RUN update-rc.d sendmail disable

### Add configuration files
# Supervisor
ADD ./config/supervisor/supervisord-nginx.conf /etc/supervisor/conf.d/supervisord-nginx.conf
Expand Down
1 change: 0 additions & 1 deletion config/php/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1056,7 +1056,6 @@ smtp_port = 25
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =/usr/sbin/sendmail
sendmail_path = "/usr/bin/msmtp -t"

; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
Expand Down
8 changes: 4 additions & 4 deletions config/supervisor/supervisord-nginx.conf
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[supervisord]
nodaemon=true

[program:mail]
[program:sendmail]
priority=2
command=/opt/mail.sh
command=/usr/sbin/sendmail -bD
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=false
autorestart=true

[program:startup]
priority=1
Expand All @@ -17,7 +17,7 @@ autorestart=false

[program:php5-fpm]
priority=9
command=service php5-fpm start
command=php5-fpm -y /etc/php5/fpm/php-fpm.conf -F
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
autorestart=true
Expand Down
1 change: 0 additions & 1 deletion cron.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

/opt/startup.sh
/opt/mail.sh
/usr/local/bin/drush cron
30 changes: 0 additions & 30 deletions mail.sh

This file was deleted.