FROM quay.io/thallian/confd-env:latest ENV OPENRESTY_VERSION 1.11.2.2 RUN addgroup syncer RUN adduser -h /app -D -G syncer syncer RUN apk --no-cache add tar redis make git libressl libssl1.0 perl gcc musl-dev pcre pcre-dev openssl-dev lua lua-dev unzip zlib zlib-dev curl luarocks libgcc WORKDIR /app RUN luarocks-5.1 install luasec RUN luarocks-5.1 install luaposix RUN luarocks-5.1 install redis-lua RUN luarocks-5.1 install busted RUN mkdir /app/openresty RUN wget -qO- https://openresty.org/download/openresty-$OPENRESTY_VERSION.tar.gz | tar -xz -C /app/openresty --strip 1 WORKDIR /app/openresty RUN ./configure --prefix=/opt/openresty && make && make install ENV PATH /opt/openresty/nginx/sbin:$PATH WORKDIR /app RUN git clone https://github.com/ostinelli/gin ADD /rootfs / RUN cd gin && patch -N -p1 < ../gin.patch RUN cd gin && luarocks-5.1 make ENV GIN_ENV production RUN git clone https://github.com/koreader/koreader-sync-server.git server RUN chown -R syncer:syncer /app RUN ln -s /usr/lib/lua /usr/local/lib/lua RUN ln -s /usr/share/lua/ /usr/local/share/lua RUN apk del tar make git gcc musl-dev pcre-dev openssl-dev lua-dev zlib-dev EXPOSE 7200 VOLUME /var/lib/redis/