Skip to content
Open
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
93 changes: 23 additions & 70 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:14.04
FROM ubuntu:18.04
MAINTAINER Derek Bourgeois <derek@ibourgeois.com>

# set some environment variables
Expand All @@ -12,22 +12,14 @@ RUN apt-get update && \
apt-get upgrade -y

# install some prerequisites
RUN apt-get install -y software-properties-common curl build-essential \
RUN apt-get install --assume-yes software-properties-common curl build-essential \
dos2unix gcc git libmcrypt4 libpcre3-dev memcached make python2.7-dev \
python-pip re2c unattended-upgrades whois vim libnotify-bin nano wget \
debconf-utils
debconf-utils locales libpng-dev rsync unzip imagemagick zip

# add some repositories
RUN apt-add-repository ppa:nginx/stable -y && \
apt-add-repository ppa:rwky/redis -y && \
apt-add-repository ppa:ondrej/php -y && \
apt-key adv --keyserver ha.pool.sks-keyservers.net --recv-keys 5072E1F5 && \
sh -c 'echo "deb http://repo.mysql.com/apt/ubuntu/ trusty mysql-5.7" >> /etc/apt/sources.list.d/mysql.list' && \
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' && \
curl -s https://packagecloud.io/gpg.key | apt-key add - && \
echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \
curl --silent --location https://deb.nodesource.com/setup_5.x | bash - && \
RUN curl --silent --location https://deb.nodesource.com/setup_10.x | bash - && \
add-apt-repository ppa:ondrej/php && \
apt-get update

# set the locale
Expand All @@ -39,7 +31,7 @@ RUN echo "LC_ALL=en_US.UTF-8" >> /etc/default/locale && \
COPY .bash_aliases /root

# install nginx
RUN apt-get install -y --force-yes nginx
RUN apt-get install --assume-yes --allow-downgrades --allow-remove-essential --allow-change-held-packages nginx
COPY homestead /etc/nginx/sites-available/
RUN rm -rf /etc/nginx/sites-available/default && \
rm -rf /etc/nginx/sites-enabled/default && \
Expand All @@ -55,41 +47,23 @@ VOLUME ["/var/cache/nginx"]
VOLUME ["/var/log/nginx"]

# install php
RUN apt-get install -y --force-yes php7.0-fpm php7.0-cli php7.0-dev php7.0-pgsql php7.0-sqlite3 php7.0-gd \
php-apcu php7.0-curl php7.0-mcrypt php7.0-imap php7.0-mysql php7.0-readline php-xdebug php-common \
php7.0-mbstring php7.0-xml php7.0-zip
RUN sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/cli/php.ini && \
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/cli/php.ini && \
sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/cli/php.ini && \
sed -i "s/error_reporting = .*/error_reporting = E_ALL/" /etc/php/7.0/fpm/php.ini && \
sed -i "s/display_errors = .*/display_errors = On/" /etc/php/7.0/fpm/php.ini && \
sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/" /etc/php/7.0/fpm/php.ini && \
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 100M/" /etc/php/7.0/fpm/php.ini && \
sed -i "s/post_max_size = .*/post_max_size = 100M/" /etc/php/7.0/fpm/php.ini && \
sed -i "s/;date.timezone.*/date.timezone = UTC/" /etc/php/7.0/fpm/php.ini && \
sed -i -e "s/;daemonize\s*=\s*yes/daemonize = no/g" /etc/php/7.0/fpm/php-fpm.conf && \
sed -i -e "s/;catch_workers_output\s*=\s*yes/catch_workers_output = yes/g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s/pm.max_children = 5/pm.max_children = 9/g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s/pm.start_servers = 2/pm.start_servers = 3/g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s/pm.min_spare_servers = 1/pm.min_spare_servers = 2/g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s/pm.max_spare_servers = 3/pm.max_spare_servers = 4/g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s/pm.max_requests = 500/pm.max_requests = 200/g" /etc/php/7.0/fpm/pool.d/www.conf && \
sed -i -e "s/;listen.mode = 0660/listen.mode = 0750/g" /etc/php/7.0/fpm/pool.d/www.conf && \
find /etc/php/7.0/cli/conf.d/ -name "*.ini" -exec sed -i -re 's/^(\s*)#(.*)/\1;\2/g' {} \;
RUN apt-get install --assume-yes --allow-downgrades --allow-remove-essential --allow-change-held-packages php-fpm php-cli php-dev php-pgsql php-sqlite3 php-gd \
php-apcu php-curl php-imap php-mysql php-readline php-xdebug php-common \
php-mbstring php-xml php-zip php-bcmath php-soap php-imagick
COPY fastcgi_params /etc/nginx/
RUN phpenmod mcrypt && \
mkdir -p /run/php/ && chown -Rf www-data.www-data /run/php
RUN mkdir -p /run/php/ && chown -Rf www-data.www-data /run/php

# install sqlite
RUN apt-get install -y sqlite3 libsqlite3-dev
# install node and databases
RUN apt-get install --assume-yes --allow-downgrades --allow-remove-essential --allow-change-held-packages nodejs sqlite3 libsqlite3-dev redis-server postgresql postgresql-contrib

# install mysql
RUN echo mysql-server mysql-server/root_password password $DB_PASS | debconf-set-selections;\
echo mysql-server mysql-server/root_password_again password $DB_PASS | debconf-set-selections;\
apt-get install -y mysql-server && \
apt-get install --assume-yes mysql-server && \
echo "[mysqld]" >> /etc/mysql/my.cnf && \
echo "default_password_lifetime = 0" >> /etc/mysql/my.cnf && \
sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf
RUN /usr/sbin/mysqld & \
RUN find /var/lib/mysql -exec touch {} \; && service mysql start && \
sleep 10s && \
echo "GRANT ALL ON *.* TO root@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION; CREATE USER 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret'; GRANT ALL ON *.* TO 'homestead'@'0.0.0.0' IDENTIFIED BY 'secret' WITH GRANT OPTION; GRANT ALL ON *.* TO 'homestead'@'%' IDENTIFIED BY 'secret' WITH GRANT OPTION; FLUSH PRIVILEGES; CREATE DATABASE homestead;" | mysql
VOLUME ["/var/lib/mysql"]
Expand All @@ -99,45 +73,24 @@ RUN curl -sS https://getcomposer.org/installer | php && \
mv composer.phar /usr/local/bin/composer && \
printf "\nPATH=\"~/.composer/vendor/bin:\$PATH\"\n" | tee -a ~/.bashrc

# install prestissimo
# RUN composer global require "hirak/prestissimo"

# install laravel envoy
RUN composer global require "laravel/envoy"

#install laravel installer
RUN composer global require "laravel/installer"

# install nodejs
RUN apt-get install -y nodejs

# install gulp
RUN /usr/bin/npm install -g gulp

# install bower
RUN /usr/bin/npm install -g bower

# install redis
RUN apt-get install -y redis-server

# install blackfire
RUN apt-get install -y blackfire-agent blackfire-php
RUN composer global require "laravel/envoy" "laravel/installer"

# install beanstalkd
RUN apt-get install -y --force-yes beanstalkd && \
sed -i "s/BEANSTALKD_LISTEN_ADDR.*/BEANSTALKD_LISTEN_ADDR=0.0.0.0/" /etc/default/beanstalkd && \
sed -i "s/#START=yes/START=yes/" /etc/default/beanstalkd && \
/etc/init.d/beanstalkd start
# RUN apt-get install --assume-yes --allow-downgrades --allow-remove-essential --allow-change-held-packages beanstalkd && \
# sed -i "s/BEANSTALKD_LISTEN_ADDR.*/BEANSTALKD_LISTEN_ADDR=0.0.0.0/" /etc/default/beanstalkd && \
# sed -i "s/#START=yes/START=yes/" /etc/default/beanstalkd && \
# /etc/init.d/beanstalkd start

# install supervisor
RUN apt-get install -y supervisor && \
RUN apt-get install --assume-yes supervisor && \
mkdir -p /var/log/supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
VOLUME ["/var/log/supervisor"]

# clean up our mess
RUN apt-get remove --purge -y software-properties-common && \
apt-get autoremove -y && \
RUN apt-get remove --purge --assume-yes software-properties-common && \
apt-get autoremove --assume-yes && \
apt-get clean && \
apt-get autoclean && \
echo -n > /var/lib/apt/extended_states && \
Expand Down
1 change: 1 addition & 0 deletions src/scripts/mysql.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ debconf-set-selections <<< "mysql-community-server mysql-community-server/root-p
debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password secret"
apt-get install -y mysql-server

echo "[mysqld]" >> /etc/mysql/my.cnf
echo "default_password_lifetime = 0" >> /etc/mysql/my.cnf

sed -i '/^bind-address/s/bind-address.*=.*/bind-address = 0.0.0.0/' /etc/mysql/my.cnf
Expand Down
2 changes: 1 addition & 1 deletion supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ command=/usr/bin/redis-server
autorestart=true

[program:crond]
command = /usr/sbin/cron
command = /usr/sbin/cron -f
user = root
autostart = true