-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
76 lines (65 loc) · 2.01 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# Dockerfile for mod_mruby on ubuntu 14.04 64bit
#
#
# Using Docker Image matsumotory/mod-mruby
#
# Pulling
# docker pull matsumotory/mod-mruby
#
# Running
# docker run -d -p 10080:80 matsumotory/mod-mruby
#
# Access
# curl http://127.0.0.1:10080/mruby-hello
#
#
# Manual Build
#
# Building
# docker build -t your_name:mod_mruby .
#
# Runing
# docker run -d -p 10080:80 your_name:mod_mruby
#
# Access
# curl http://127.0.0.1:10080/mruby-hello
#
FROM ubuntu:14.04
MAINTAINER ujun
RUN apt-get -y update
RUN apt-get -y install sudo openssh-server
RUN apt-get -y install git
RUN apt-get -y install curl
RUN apt-get -y install apache2 apache2-dev apache2-utils
RUN apt-get -y install rake
RUN apt-get -y install ruby2.0 ruby2.0-dev
RUN apt-get -y install bison
RUN apt-get -y install libcurl4-openssl-dev
RUN apt-get -y install libhiredis-dev
RUN apt-get -y install libmarkdown2-dev
RUN apt-get -y install libcap-dev
RUN apt-get -y install libcgroup-dev
RUN cd /usr/local/src/ && git clone https://github.com/matsumoto-r/mod_mruby.git
RUN cd /usr/local/src/mod_mruby && sh build.sh && make install
EXPOSE 80
ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_RUN_DIR /var/run/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2
ENV APACHE_LOG_DIR /var/log/apache2
ENV LANG C
ADD docker/hook /etc/apache2/hook
ADD docker/conf/mruby.conf /etc/apache2/mods-available/mruby.conf
RUN cd /etc/apache2/mods-enabled && ln -s ../mods-available/mruby.conf mruby.conf
# sample check for now
RUN service apache2 restart && curl http://127.0.0.1/mruby-test && curl http://127.0.0.1/mruby-hello
# clone mruby
RUN cd /var/www/html; git clone https://github.com/mruby/mruby
RUN chown -R www-data:www-data /var/www/html/mruby
# create the module directory and add files
RUN mkdir /etc/apache2/mruby-build
ADD docker/conf/mruby.conf /etc/apache2/mruby-build/mods-available/mruby.conf
ADD docker/hook/mruby-build.rb /etc/apache2/mruby-build/mruby-build.rb
CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]