Skip to content

Commit

Permalink
Dockerfile added
Browse files Browse the repository at this point in the history
  • Loading branch information
sasanrose committed Oct 25, 2016
1 parent e88653f commit 7b258ff
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 0 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
logs/
36 changes: 36 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
FROM php:5.6-apache

MAINTAINER sasan.rose@gmail.com

RUN apt-get update && apt-get install -y \
gearman-job-server \
git-core \
libgearman-dev \
&& pecl install gearman \
&& docker-php-ext-enable gearman

EXPOSE 80


COPY docker/default.conf /etc/apache2/sites-available/000-default.conf
COPY docker/php.ini /usr/local/etc/php/
COPY docker/start.sh /usr/src/start.sh

WORKDIR /usr/src

RUN git clone https://github.com/phpredis/phpredis.git
WORKDIR /usr/src/phpredis
RUN phpize \
&& ./configure \
&& make \
&& make install \
&& docker-php-ext-enable redis

WORKDIR /var/www/html
COPY . phpredmin/
RUN mkdir phpredmin/logs && chown www-data:www-data phpredmin/logs -R

WORKDIR /var/www/html/phpredmin/public

RUN chmod u+x /usr/src/start.sh
CMD ["/usr/src/start.sh"]
8 changes: 8 additions & 0 deletions docker/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/phpredmin/public

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
1 change: 1 addition & 0 deletions docker/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
variables_order = "EGPCS"
12 changes: 12 additions & 0 deletions docker/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#! /bin/sh

# Run gearman job server
gearmand -d
# Run gearman work
php index.php gearman/index &
# Start web server
apache2-foreground &

trap "pkill gearmand && pkill -WINCH apache2" TERM

wait

0 comments on commit 7b258ff

Please sign in to comment.