Skip to content

Commit

Permalink
Docker update
Browse files Browse the repository at this point in the history
  • Loading branch information
pensiero committed May 2, 2017
1 parent e9e1bb8 commit 010861e
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 105 deletions.
2 changes: 1 addition & 1 deletion .bowerrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"directory" : "vendor"
"directory" : "bower_components"
}
16 changes: 11 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
.~lock.*
.buildpath
.DS_Store
.env
.env_apache
.idea
.project
.settings
*.min.*
*.css.map
log/
node_modules/
vendor/*
composer.phar
docker-compose.override.yml
dump.rdb
dump.sql
/log/
/logs/
/bower_components/
/node_modules/
/vendor/
55 changes: 8 additions & 47 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,54 +1,15 @@
FROM ubuntu:16.04
FROM pensiero/apache-php

MAINTAINER Oscar Fanelli <[email protected]>
# Labels
LABEL maintainer "[email protected]"

ENV PROJECT_PATH=/var/www \
DEBIAN_FRONTEND=noninteractive \
APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
APACHE_LOCK_DIR=/var/lock/apache2 \
APACHE_PID_FILE=/var/run/apache2/apache2.pid \
PHP_MODS_CONF=/etc/php/7.0/mods-available \
PHP_INI=/etc/php/7.0/apache2/php.ini \
TERM=xterm

# Utilities, Apache, PHP, and supplementary programs
RUN apt-get update -q && apt-get upgrade -yqq && apt-get install -yqq --force-yes \
curl \
git \
npm \
wget \
apache2 \
libapache2-mod-php7.0 \
php7.0
RUN ln -s "$(which nodejs)" /usr/bin/node

# Apache mods
RUN a2enmod rewrite expires headers

# PHP.ini file: enable <? ?> tags and quieten logging
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" $PHP_INI && \
sed -i "s/memory_limit = .*/memory_limit = 32M/" $PHP_INI && \
sed -i "s/display_errors = .*/display_errors = Off/" $PHP_INI && \
sed -i "s/display_startup_errors = .*/display_startup_errors = Off/" $PHP_INI && \
sed -i "s/post_max_size = .*/post_max_size = 1M/" $PHP_INI && \
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 1M/" $PHP_INI && \
sed -i "s/max_file_uploads = .*/max_file_uploads = 1/" $PHP_INI && \
sed -i "s/error_reporting = .*$/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/" $PHP_INI

# Apache2 conf
RUN echo "ServerName localhost" | tee /etc/apache2/conf-available/fqdn.conf
RUN a2enconf fqdn
# PHP.ini file: enable <? ?> tags and quiet logging
RUN sed -i "s/display_errors = .*/display_errors = On/" $PHP_INI && \
sed -i "s/display_startup_errors = .*/display_startup_errors = On/" $PHP_INI && \
sed -i "s/error_reporting = .*/error_reporting = E_ALL | E_STRICT/" $PHP_INI

# Cleanup
RUN apt-get purge -yq \
wget \
zip \
patch && \
apt-get autoremove -yqq

# Port to expose
EXPOSE 80
RUN apt-get autoremove -yqq

# VirtualHost
COPY config/docker/apache-virtualhost.conf /etc/apache2/sites-available/000-default.conf
Expand Down
60 changes: 8 additions & 52 deletions Dockerfile_development
Original file line number Diff line number Diff line change
@@ -1,62 +1,18 @@
FROM ubuntu:16.04
FROM pensiero/apache-php-mysql

MAINTAINER Oscar Fanelli <[email protected]>
# Labels
LABEL maintainer "[email protected]"

ENV PROJECT_PATH=/var/www \
DEBIAN_FRONTEND=noninteractive \
APACHE_RUN_USER=www-data \
APACHE_RUN_GROUP=www-data \
APACHE_LOCK_DIR=/var/lock/apache2 \
APACHE_PID_FILE=/var/run/apache2/apache2.pid \
PHP_MODS_CONF=/etc/php/7.0/mods-available \
PHP_INI=/etc/php/7.0/apache2/php.ini \
TERM=xterm

# Utilities, Apache, PHP, and supplementary programs
RUN apt-get update -q && apt-get upgrade -yqq && apt-get install -yqq --force-yes \
nano \
inotify-tools \
curl \
git \
npm \
wget \
apache2 \
libapache2-mod-php7.0 \
php7.0
RUN ln -s "$(which nodejs)" /usr/bin/node

# Apache mods
RUN a2enmod rewrite expires headers

# PHP.ini file: enable <? ?> tags and quieten logging
RUN sed -i "s/short_open_tag = Off/short_open_tag = On/" $PHP_INI && \
sed -i "s/memory_limit = .*/memory_limit = 32M/" $PHP_INI && \
sed -i "s/display_errors = .*/display_errors = Off/" $PHP_INI && \
sed -i "s/display_startup_errors = .*/display_startup_errors = Off/" $PHP_INI && \
sed -i "s/post_max_size = .*/post_max_size = 1M/" $PHP_INI && \
sed -i "s/upload_max_filesize = .*/upload_max_filesize = 1M/" $PHP_INI && \
sed -i "s/max_file_uploads = .*/max_file_uploads = 1/" $PHP_INI && \
sed -i "s/error_reporting = .*$/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/" $PHP_INI

# Apache2 conf
RUN echo "ServerName localhost" | tee /etc/apache2/conf-available/fqdn.conf
RUN a2enconf fqdn
# PHP.ini file: enable <? ?> tags and quiet logging
RUN sed -i "s/display_errors = .*/display_errors = On/" $PHP_INI && \
sed -i "s/display_startup_errors = .*/display_startup_errors = On/" $PHP_INI && \
sed -i "s/error_reporting = .*/error_reporting = E_ALL | E_STRICT/" $PHP_INI

# Cleanup
RUN apt-get purge -yq \
wget \
zip \
patch && \
apt-get autoremove -yqq

# Port to expose
EXPOSE 80
RUN apt-get autoremove -yqq

# VirtualHost
COPY config/docker/apache-virtualhost.conf /etc/apache2/sites-available/000-default.conf

# Move to project path directory
WORKDIR $PROJECT_PATH

# Remove pre-existent apache pid and start apache
CMD rm -f $APACHE_PID_FILE && ./config/docker/start/development.sh
File renamed without changes.

0 comments on commit 010861e

Please sign in to comment.