Dockerfile

Mon, 22 Nov 2021 10:40:15 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Mon, 22 Nov 2021 10:40:15 +0000
changeset 2
8e14bb7f77a2
parent 1
ab05314b412c
child 3
16c9e2363135
permissions
-rw-r--r--

Upgrade to Debian bullseye

0
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
1 ####################################
2
8e14bb7f77a2 Upgrade to Debian bullseye
Matthew Wild <mwild1@gmail.com>
parents: 1
diff changeset
2 FROM debian:bullseye-slim as build
0
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
3
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
4 MAINTAINER Matthew Wild <mwild1@gmail.com>
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
5
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
6 RUN apt-get update \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
7 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
8 lua5.2 \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
9 liblua5.2-dev \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
10 libidn11-dev \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
11 libssl-dev \
1
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
12 libunbound-dev \
0
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
13 build-essential \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
14 && rm -rf /var/lib/apt/lists/*
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
15
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
16 WORKDIR /tmp/build
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
17
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
18 ADD https://hg.prosody.im/trunk/archive/tip.tar.gz ./prosody.tar.gz
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
19
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
20 RUN tar --strip-components=1 -xzf prosody.tar.gz \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
21 && ./configure && make
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
22
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
23 ADD src/web/ util/
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
24
1
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
25 ADD https://code.zash.se/dl/luaunbound/luaunbound-0.5.tar.gz ./luaunbound-0.5.tar.gz
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
26
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
27 RUN tar -xzf luaunbound-0.5.tar.gz \
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
28 && make -C luaunbound-0.5
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
29
0
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
30 ############################
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
31 FROM debian:buster-slim
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
32
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
33 RUN apt-get update \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
34 && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
35 tini \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
36 lua5.2 \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
37 lua-cjson \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
38 lua-expat \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
39 lua-filesystem \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
40 lua-sec \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
41 lua-socket \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
42 libidn11 \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
43 lua-dbi-postgresql \
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
44 lua-scrypt \
1
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
45 libunbound8 \
0
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
46 && rm -rf /var/lib/apt/lists/*
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
47
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
48 COPY --from=build /tmp/build/util /usr/local/lib/lua-web-app/util
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
49 COPY --from=build /tmp/build/net /usr/local/lib/lua-web-app/net
1
ab05314b412c Add lua-unbound
Matthew Wild <mwild1@gmail.com>
parents: 0
diff changeset
50 COPY --from=build /tmp/build/luaunbound-0.5/lunbound.so /usr/local/lib/lua/5.2/lunbound.so
0
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
51
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
52 ENV LUA_WEB_APP_FRAMEWORK /usr/local/lib/lua-web-app
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
53
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
54 ADD src/ /usr/local/lib/lua-web-app
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
55
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
56 WORKDIR /opt
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
57
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
58 ADD default-app/html ./html
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
59 ADD default-app/app ./app
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
60
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
61 ADD config.dist.lua /etc/app/config.lua
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
62
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
63 VOLUME /var/lib/app
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
64
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
65 ENV LISTEN_INTERFACE *
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
66 ENV LISTEN_PORT 8007
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
67 EXPOSE 8007
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
68
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
69 ENTRYPOINT ["/usr/bin/tini"]
6279a7d40ae7 Initial commit
Matthew Wild <mwild1@gmail.com>
parents:
diff changeset
70 CMD ["/usr/bin/lua5.2", "/usr/local/lib/lua-web-app/main.lua", "/etc/app/config.lua"]

mercurial