forked from e621ng/e621ng
[Docker] Use mutlistage build for iqdb
This also pulls in ruby 3 as the repos dependencies got updated
This commit is contained in:
parent
84de15b27d
commit
a0a8d7c1ce
@ -1,12 +1,11 @@
|
|||||||
FROM ruby:2.7.3-alpine
|
FROM alpine:3.17 as builder
|
||||||
|
|
||||||
ADD https://api.github.com/repos/e621ng/iqdbs/git/refs/heads/master /tmp/iqdbs_version.json
|
|
||||||
COPY iqdb.patch /tmp/iqdb.patch
|
COPY iqdb.patch /tmp/iqdb.patch
|
||||||
ENV IQDB_VERSION=20161008
|
ENV IQDB_VERSION=20161008
|
||||||
ENV IQDB_CHECKSUM=daa4812b35f84bc7e2f07661fd9abf73a06738c76beb92252666a86ebaea3c64
|
ENV IQDB_CHECKSUM=daa4812b35f84bc7e2f07661fd9abf73a06738c76beb92252666a86ebaea3c64
|
||||||
|
ARG BUILD_DEPS="build-base libjpeg-turbo-dev gd-dev"
|
||||||
|
|
||||||
RUN apk --no-cache add build-base git libjpeg-turbo-dev gd-dev bash \
|
RUN apk --no-cache add $BUILD_DEPS \
|
||||||
# iqdb
|
|
||||||
&& cd /tmp \
|
&& cd /tmp \
|
||||||
&& wget -q https://iqdb.org/code/iqdb-$IQDB_VERSION.tar.bz2 \
|
&& wget -q https://iqdb.org/code/iqdb-$IQDB_VERSION.tar.bz2 \
|
||||||
&& echo "$IQDB_CHECKSUM iqdb-$IQDB_VERSION.tar.bz2" | sha256sum -c - \
|
&& echo "$IQDB_CHECKSUM iqdb-$IQDB_VERSION.tar.bz2" | sha256sum -c - \
|
||||||
@ -14,19 +13,19 @@ RUN apk --no-cache add build-base git libjpeg-turbo-dev gd-dev bash \
|
|||||||
&& cd iqdb \
|
&& cd iqdb \
|
||||||
&& patch -N -i /tmp/iqdb.patch \
|
&& patch -N -i /tmp/iqdb.patch \
|
||||||
&& make EXTRADEFS="-include stdint.h" -j$(nproc) \
|
&& make EXTRADEFS="-include stdint.h" -j$(nproc) \
|
||||||
&& cp iqdb /usr/bin \
|
&& apk del $BUILD_DEPS
|
||||||
# iqdbs
|
|
||||||
&& git clone https://github.com/e621ng/iqdbs /iqdbs \
|
|
||||||
&& bundler install --gemfile /iqdbs/Gemfile \
|
|
||||||
# cleanup
|
|
||||||
&& rm /tmp/iqdb-$IQDB_VERSION.tar.bz2 \
|
|
||||||
&& rm -rf /tmp/iqdb \
|
|
||||||
&& apk del build-base git
|
|
||||||
|
|
||||||
# shoreman
|
FROM ruby:3.1.3-alpine3.17
|
||||||
RUN wget -O /usr/bin/shoreman https://github.com/chrismytton/shoreman/raw/master/shoreman.sh \
|
|
||||||
&& chmod +x /usr/bin/shoreman
|
RUN apk --no-cache add git libjpeg-turbo gd tzdata
|
||||||
|
|
||||||
|
ADD https://api.github.com/repos/e621ng/iqdbs/git/refs/heads/master /tmp/iqdbs_version.json
|
||||||
|
RUN git clone https://github.com/e621ng/iqdbs /iqdbs \
|
||||||
|
&& bundler install --gemfile /iqdbs/Gemfile \
|
||||||
|
&& gem i foreman
|
||||||
|
|
||||||
|
COPY --from=builder /tmp/iqdb/iqdb /usr/bin/
|
||||||
|
|
||||||
WORKDIR /iqdbs
|
WORKDIR /iqdbs
|
||||||
|
|
||||||
CMD [ "shoreman" ]
|
CMD ["foreman", "start"]
|
||||||
|
Loading…
Reference in New Issue
Block a user