-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile
37 lines (27 loc) · 1.25 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM ubuntu
MAINTAINER Christian Lück <[email protected]>
RUN DEBIAN_FRONTEND=noninteractive apt-get update && apt-get install -y \
nginx php5-fpm supervisor \
wget unzip php5-cli
# install phpvirtualbox
RUN wget http://sourceforge.net/projects/phpvirtualbox/files/phpvirtualbox-4.3-1.zip/download -O phpvirtualbox-4.3-1.zip
RUN unzip phpvirtualbox-4.3-1.zip
RUN mv phpvirtualbox-4.3-1 /var/www
ADD config.php /var/www/config.php
RUN chown www-data:www-data -R /var/www
# add phpvirtualbox as the only nginx site
ADD phpvirtualbox.nginx.conf /etc/nginx/sites-available/phpvirtualbox
RUN ln -s /etc/nginx/sites-available/phpvirtualbox /etc/nginx/sites-enabled/phpvirtualbox
RUN rm /etc/nginx/sites-enabled/default
WORKDIR /var/www
# use supervisor to monitor all services
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# add startup script to write linked instances to server config
ADD servers-from-env.php /servers-from-env.php
# add empty dummy config that will be overwritten by CMD script
RUN echo "<?php return array(); ?>" > /var/www/config-servers.php
# write linked instances to config, then monitor all services
CMD php /servers-from-env.php && \
supervisord -c /etc/supervisor/conf.d/supervisord.conf
# expose only nginx HTTP port
EXPOSE 80