-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
68 lines (61 loc) · 1.92 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
from alpine
run apk add curl openssl openssh git linux-headers perl pcre
run apk add pcre-dev openssl-dev make gcc libzip-dev libaio-dev musl-dev
# OpenResty
workdir /tmp
copy https://openresty.org/download/openresty-1.15.8.2.tar.gz openresty-1.15.8.2.tar.gz
run tar -xzf openresty-*.tar.gz
workdir openresty-1.15.8.2
run ./configure \
--with-pcre-jit \
--with-http_v2_module \
--with-http_ssl_module \
--with-mail \
--with-stream \
--with-threads \
--with-file-aio \
--with-http_realip_module \
--with-stream_ssl_module \
--with-stream \
--with-stream_ssl_module \
--with-stream \
--with-stream_ssl_module \
--with-http_stub_status_module \
&& make -j $(nproc) && make install \
&& ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin
# cleanup
run rm -rf /tmp/*
# Make sure git always uses HTTPS instead of SSH
run git config --global url."https://github.com/".insteadOf "[email protected]:"; \
git config --global url."https://github.com/".insteadOf "git://github.com/"
# LuaJIT
workdir /tmp
copy http://luajit.org/download/LuaJIT-2.0.4.tar.gz LuaJIT-2.0.4.tar.gz
run tar -xzf LuaJIT-*.tar.gz; rm *.tar.gz; mv LuaJIT-* luajit
workdir luajit
run make -j $(nproc) && make install
# cleanup
run rm -rf /tmp/*
# Luarocks
workdir /tmp
run apk add unzip
copy http://luarocks.github.io/luarocks/releases/luarocks-3.2.1.tar.gz luarocks-3.2.1.tar.gz
run tar -xzf luarocks-*.tar.gz; rm *.tar.gz; mv luarocks-* luarocks
workdir luarocks
run ./configure && make bootstrap
# cleanup
run rm -rf /tmp/*
# Restia
workdir /tmp
run apk add yaml-dev
run luarocks install restia --dev
# # Build a minimal restia image
# from alpine
# # Necessary requirements
# run apk add curl openssh git linux-headers perl pcre libgcc openssl yaml
# # Pull openresty, luarocks, restia, etc. from the restia image
# copy --from=restia /usr/local /usr/local
# # Copy the restia application
# copy application /etc/application
# workdir /etc/application
# cmd restia run