Dockerfile

changeset 0
6279a7d40ae7
child 1
ab05314b412c
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Dockerfile	Tue Mar 09 12:16:56 2021 +0000
@@ -0,0 +1,62 @@
+####################################
+FROM debian:buster-slim as build
+
+MAINTAINER Matthew Wild <mwild1@gmail.com>
+
+RUN apt-get update \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        lua5.2 \
+        liblua5.2-dev \
+        libidn11-dev \
+        libssl-dev \
+        build-essential \
+    && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /tmp/build
+
+ADD https://hg.prosody.im/trunk/archive/tip.tar.gz ./prosody.tar.gz
+
+RUN tar --strip-components=1 -xzf prosody.tar.gz \
+ && ./configure && make
+
+ADD src/web/ util/
+
+############################
+FROM debian:buster-slim
+
+RUN apt-get update \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
+        tini \
+        lua5.2 \
+        lua-cjson \
+        lua-expat \
+	lua-filesystem \
+        lua-sec \
+        lua-socket \
+        libidn11 \
+        lua-dbi-postgresql \
+        lua-scrypt \
+    && rm -rf /var/lib/apt/lists/*
+
+COPY --from=build /tmp/build/util /usr/local/lib/lua-web-app/util
+COPY --from=build /tmp/build/net /usr/local/lib/lua-web-app/net
+
+ENV LUA_WEB_APP_FRAMEWORK /usr/local/lib/lua-web-app
+
+ADD src/ /usr/local/lib/lua-web-app
+
+WORKDIR /opt
+
+ADD default-app/html ./html
+ADD default-app/app ./app
+
+ADD config.dist.lua /etc/app/config.lua
+
+VOLUME /var/lib/app
+
+ENV LISTEN_INTERFACE *
+ENV LISTEN_PORT 8007
+EXPOSE 8007
+
+ENTRYPOINT ["/usr/bin/tini"]
+CMD ["/usr/bin/lua5.2", "/usr/local/lib/lua-web-app/main.lua", "/etc/app/config.lua"]

mercurial