Skip to content

Commit ef85799

Browse files
author
orette
committed
Added HHVM container and used environment variable for switching
1 parent 4d24521 commit ef85799

5 files changed

Lines changed: 62 additions & 4 deletions

File tree

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
INSTALL_PRESTISSIMO=false
1+
INSTALL_PRESTISSIMO=false
2+
PHP_PROCESS_MANAGER=php-fpm

docker-compose.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ services:
55
### Nginx Server Container ##################################
66

77
nginx:
8-
build: ./nginx
8+
build:
9+
context: ./nginx
10+
args:
11+
- PHP_UPSTREAM=${PHP_PROCESS_MANAGER}
912
volumes_from:
1013
- volumes_source
1114
volumes:
@@ -14,7 +17,7 @@ services:
1417
- "80:80"
1518
- "443:443"
1619
links:
17-
- php-fpm
20+
- ${PHP_PROCESS_MANAGER}
1821

1922
### PHP-FPM Container #######################################
2023

@@ -29,6 +32,17 @@ services:
2932
links:
3033
- workspace
3134

35+
### HHVM Container ##########################################
36+
37+
hhvm:
38+
build: ./hhvm
39+
volumes_from:
40+
- volumes_source
41+
expose:
42+
- "9000"
43+
links:
44+
- workspace
45+
3246
### MySQL Container #########################################
3347

3448
mysql:

hhvm/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ubuntu:14.04
2+
3+
RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0x5a16e7281be7a449
4+
RUN apt-get update -y && apt-get install -y software-properties-common \
5+
&& add-apt-repository "deb http://dl.hhvm.com/ubuntu $(lsb_release -sc) main" \
6+
&& apt-get update -y \
7+
&& apt-get install -y hhvm \
8+
&& apt-get clean \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
RUN mkdir -p /var/www/laravel
12+
13+
ADD server.ini /etc/hhvm/server.ini
14+
15+
RUN usermod -u 1000 www-data
16+
17+
WORKDIR /var/www/laravel
18+
19+
CMD ["/usr/bin/hhvm", "-m", "server", "-c", "/etc/hhvm/server.ini"]
20+
21+
EXPOSE 9000

hhvm/server.ini

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
; php options
2+
3+
pid = /var/run/hhvm/pid
4+
5+
; hhvm specific
6+
hhvm.server.port = 9000
7+
hhvm.server.type = fastcgi
8+
hhvm.server.default_document = index.php
9+
hhvm.server.error_document404 = index.php
10+
hhvm.server.upload.upload_max_file_size = 25M
11+
hhvm.log.level = Error
12+
hhvm.log.header = true
13+
hhvm.log.access[default][file] = /var/log/hhvm/access.log
14+
hhvm.log.access[default][format] = "%h %l %u %t \"%r\" %>s %b"
15+
hhvm.server.source_root=/var/www/laravel/public
16+
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc
17+
18+
; Uncomment to log to files instead of STDOUT
19+
;hhvm.log.use_log_file = true
20+
;hhvm.log.file = /var/log/hhvm/error.log

nginx/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ MAINTAINER Mahmoud Zalt <mahmoud@zalt.me>
55
ADD nginx.conf /etc/nginx/
66
ADD laravel.conf /etc/nginx/sites-available/
77

8-
RUN echo "upstream php-upstream { server php-fpm:9000; }" > /etc/nginx/conf.d/upstream.conf
8+
ARG PHP_UPSTREAM
9+
10+
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM}:9000; }" > /etc/nginx/conf.d/upstream.conf
911

1012
RUN usermod -u 1000 www-data
1113

0 commit comments

Comments
 (0)