Dockerfile 2.5 KB

1234567891011121314151617181920212223242526272829303132
  1. FROM debian:stretch
  2. MAINTAINER Jonas Wielicki <jonas@wielicki.name>
  3. ENV DEBIAN_FRONTEND noninteractive
  4. RUN apt-get update && apt-get -y dist-upgrade && apt-get install -y --no-install-suggests lua5.1 mercurial build-essential git lua5.1-dev libz-dev libunbound-dev lua-dbi-postgresql libidn11-dev lua-socket libunbound2 luajit wget lua-expat python-twisted dns-root-data
  5. WORKDIR /opt
  6. COPY . xmppoke/
  7. WORKDIR /opt/xmppoke/
  8. RUN git clone https://github.com/xnyhps/luasec.git && cd luasec && git checkout 64bebd9c9283ce11dfa60945938d0a529861d824 && cd ..
  9. RUN hg clone http://code.zash.se/luaunbound/ && cd luaunbound && hg update -r 8356eb09ebaa && cd ..
  10. WORKDIR /opt/
  11. RUN hg clone http://code.matthewwild.co.uk/verse/
  12. RUN mkdir xmppoke/util
  13. RUN hg clone http://code.matthewwild.co.uk/squish/ && cd squish && make && make install && cd .. && rm squish -rf
  14. RUN git clone https://github.com/PeterMosmans/openssl --depth 1 && cd openssl && ./config --prefix=/usr/local/ --openssldir=/etc/ssl enable-zlib enable-ssl2 enable-rc5 enable-rc2 enable-GOST enable-cms enable-md2 enable-mdc2 enable-ec enable-ec2m enable-ecdh enable-ecdsa enable-seed enable-camellia enable-idea enable-rfc3779 enable-ec_nistp_64_gcc_128 experimental-jpake shared -DOPENSSL_USE_BUILD_DATE && make depend && make && make install && cd .. && rm -rf openssl
  15. RUN hg clone https://hg.prosody.im/0.9/ prosody && cd prosody && ./configure --with-lua-include=/usr/include/lua5.1 && make && cp util/encodings.so util/hashes.so ../xmppoke/util/ && cd .. && rm prosody -rf
  16. RUN cd xmppoke/luasec && make "INC_PATH=-I/opt/local/include -I/usr/include -I/usr/local/include -I/usr/include/lua5.1" linux && make LUACPATH=/usr/local/lib/lua/5.1 LUAPATH=/usr/local/share/lua/5.1 install
  17. RUN cd xmppoke/luaunbound && make -B LUA_VERSION=5.1 CFLAGS='-fPIC -I/usr/include/lua5.1 -DIANA_ROOT_TA_FILE=\"/usr/share/dns/root.ds\"' && cp lunbound.so ../
  18. RUN cd verse && ./configure && make && make install
  19. RUN ln -s /opt/verse /usr/local/share/lua/5.1/
  20. RUN cd xmppoke && sed -ri '/local proxy_port/s/9150/9050/;/settimeout/s/5/10/' onions.lua && squish --use-http --no-minify --debug && sed -ri '1s/^(.*)$/_G.socket = require"socket"\n\1/' xmppoke.lua
  21. RUN apt-get install -y --no-install-suggests --no-install-recommends tor
  22. RUN apt-get remove -y build-essential lua5.1-dev libz-dev libunbound-dev libidn11-dev && apt-get -y autoremove && apt clean
  23. RUN git clone https://github.com/horazont/xmppoke-queue --depth 1
  24. COPY docker-entrypoint.sh /
  25. EXPOSE 1337
  26. CMD /docker-entrypoint.sh