2020-07-26 08:40:20 +00:00
|
|
|
FROM alpine:3.12 as builder
|
2016-08-16 08:48:34 +00:00
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
ENV RESTY_VERSION=1.15.8.2
|
|
|
|
ENV RESTY_SHA256_SUM=436b4e84d547a97a18cf7a2522daf819da8087b188468946b5a89c0dd1ca5d16
|
2017-06-13 12:35:44 +00:00
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
RUN apk --no-cache add \
|
|
|
|
bash \
|
|
|
|
coreutils \
|
|
|
|
perl \
|
|
|
|
make \
|
|
|
|
automake \
|
|
|
|
autoconf \
|
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
curl \
|
|
|
|
lua5.1-dev \
|
|
|
|
musl-dev \
|
|
|
|
pcre-dev \
|
|
|
|
zlib-dev \
|
|
|
|
lua5.1 \
|
|
|
|
luarocks5.1 \
|
|
|
|
openssl \
|
|
|
|
openssl-dev \
|
|
|
|
pcre-dev \
|
2020-07-26 09:33:43 +00:00
|
|
|
zlib-dev \
|
|
|
|
patch
|
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
RUN ln -s /usr/bin/aclocal-1.16 /usr/bin/aclocal-1.15
|
|
|
|
RUN ln -s /usr/bin/automake-1.16 /usr/bin/automake-1.15
|
2016-08-16 08:48:34 +00:00
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
RUN wget https://openresty.org/download/openresty-$RESTY_VERSION.tar.gz
|
|
|
|
RUN echo "$RESTY_SHA256_SUM openresty-$RESTY_VERSION.tar.gz" | sha256sum -c - || exit 1
|
|
|
|
RUN tar xvf openresty-$RESTY_VERSION.tar.gz
|
|
|
|
RUN cd openresty-$RESTY_VERSION && \
|
|
|
|
./configure --with-pcre-jit --with-ipv6 --with-http_v2_module && \
|
|
|
|
make && \
|
|
|
|
make install
|
2016-08-16 09:42:09 +00:00
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
ADD gin.patch /gin.patch
|
|
|
|
RUN git clone https://github.com/ostinelli/gin
|
2016-08-16 08:48:34 +00:00
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
WORKDIR /gin
|
|
|
|
RUN patch -N -p1 < ../gin.patch
|
|
|
|
RUN luarocks-5.1 make
|
2016-08-16 08:48:34 +00:00
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
WORKDIR /
|
|
|
|
RUN git clone https://github.com/koreader/koreader-sync-server.git
|
|
|
|
|
|
|
|
FROM thallian/confd-env:latest
|
|
|
|
|
|
|
|
RUN addgroup syncer
|
|
|
|
RUN adduser -h /app -D -G syncer syncer
|
|
|
|
|
|
|
|
COPY --from=builder /usr/local/openresty /usr/local/openresty
|
|
|
|
COPY --from=builder /usr/local/share/lua/5.1 /usr/local/share/lua/5.1
|
|
|
|
COPY --from=builder /usr/local/lib/lua/5.1 /usr/local/lib/lua/5.1
|
|
|
|
COPY --from=builder /usr/local/lib/luarocks/rocks-5.1 /usr/local/lib/luarocks/rocks-5.1
|
|
|
|
COPY --from=builder /usr/local/bin/gin /usr/local/bin/gin
|
|
|
|
COPY --from=builder --chown=syncer:syncer /koreader-sync-server /app/server
|
|
|
|
|
|
|
|
RUN ln -s /usr/local/openresty/nginx/sbin/nginx /usr/local/bin/nginx
|
|
|
|
|
|
|
|
RUN apk --no-cache add \
|
|
|
|
redis \
|
|
|
|
openssl \
|
|
|
|
libgcc \
|
|
|
|
pcre \
|
|
|
|
lua5.1 \
|
|
|
|
unzip \
|
|
|
|
zlib
|
2016-08-16 08:48:34 +00:00
|
|
|
|
|
|
|
ADD /rootfs /
|
|
|
|
|
|
|
|
ENV GIN_ENV production
|
|
|
|
|
2019-12-21 11:37:52 +00:00
|
|
|
WORKDIR /
|
2016-08-16 10:39:39 +00:00
|
|
|
|
2016-08-16 08:48:34 +00:00
|
|
|
EXPOSE 7200
|
2016-08-16 12:07:19 +00:00
|
|
|
VOLUME /var/lib/redis/
|