diff --git a/.env b/.env index 5b536771..43554f33 100644 --- a/.env +++ b/.env @@ -1 +1,2 @@ -INSTALL_PRESTISSIMO=false \ No newline at end of file +INSTALL_PRESTISSIMO=false +PHP_PROCESS_MANAGER=php-fpm diff --git a/docker-compose.yml b/docker-compose.yml index 0426195a..4f225f2f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,10 @@ services: ### Nginx Server Container ################################## nginx: - build: ./nginx + build: + context: ./nginx + args: + - PHP_UPSTREAM=${PHP_PROCESS_MANAGER} volumes_from: - volumes_source volumes: @@ -14,7 +17,7 @@ services: - "80:80" - "443:443" links: - - php-fpm + - ${PHP_PROCESS_MANAGER} ### PHP-FPM Container ####################################### @@ -29,6 +32,17 @@ services: links: - workspace +### HHVM Container ########################################## + + hhvm: + build: ./hhvm + volumes_from: + - volumes_source + expose: + - "9000" + links: + - workspace + ### MySQL Container ######################################### mysql: diff --git a/hhvm/Dockerfile b/hhvm/Dockerfile new file mode 100644 index 00000000..300bf29c --- /dev/null +++ b/hhvm/Dockerfile @@ -0,0 +1,21 @@ +FROM ubuntu:14.04 + +RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449 +RUN apt-get update -y && apt-get install -y software-properties-common \ + && add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" \ + && apt-get update -y \ + && apt-get install -y hhvm \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /var/www/laravel + +ADD server.ini /etc/hhvm/server.ini + +RUN usermod -u 1000 www-data + +WORKDIR /var/www/laravel + +CMD ["/usr/bin/hhvm", "-m", "server", "-c", "/etc/hhvm/server.ini"] + +EXPOSE 9000 diff --git a/hhvm/server.ini b/hhvm/server.ini new file mode 100644 index 00000000..47d20172 --- /dev/null +++ b/hhvm/server.ini @@ -0,0 +1,20 @@ +; php options + +pid = /var/run/hhvm/pid + +; hhvm specific +hhvm.server.port = 9000 +hhvm.server.type = fastcgi +hhvm.server.default_document = index.php +hhvm.server.error_document404 = index.php +hhvm.server.upload.upload_max_file_size = 25M +hhvm.log.level = Error +hhvm.log.header = true +hhvm.log.access[default][file] = /var/log/hhvm/access.log +hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b" +hhvm.server.source_root=/var/www/laravel/public +hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc + +; Uncomment to log to files instead of STDOUT +;hhvm.log.use_log_file = true +;hhvm.log.file = /var/log/hhvm/error.log diff --git a/nginx/Dockerfile b/nginx/Dockerfile index 495382fe..5dec1310 100644 --- a/nginx/Dockerfile +++ b/nginx/Dockerfile @@ -5,7 +5,9 @@ MAINTAINER Mahmoud Zalt ADD nginx.conf /etc/nginx/ ADD laravel.conf /etc/nginx/sites-available/ -RUN echo "upstream php-upstream { server php-fpm:9000; }" > /etc/nginx/conf.d/upstream.conf +ARG PHP_UPSTREAM + +RUN echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf RUN usermod -u 1000 www-data