Optimise Dockerfile

This commit is contained in:
Akito
2023-08-25 15:20:44 +02:00
parent 2d422b9803
commit a16e214f1b

View File

@ -1,9 +1,14 @@
# Built by Akito
# npub1wprtv89px7z2ut04vvquscpmyfuzvcxttwy2csvla5lvwyj807qqz5aqle
FROM alpine:3.18.3 as build
FROM alpine:3.18.3 AS build
ENV TZ=Europe/London
WORKDIR /build
COPY . .
RUN \
apk --no-cache add \
linux-headers \
@ -13,7 +18,6 @@ RUN \
pkgconfig \
libtool \
ca-certificates \
perl-yaml-libyaml \
perl-yaml \
perl-template-toolkit \
perl-app-cpanminus \
@ -24,14 +28,13 @@ RUN \
libsecp256k1-dev \
zstd-dev \
&& rm -rf /var/cache/apk/* \
&& cpanm Regexp::Grammars
COPY . .
RUN git submodule update --init
RUN make setup-golpe
RUN make -j4
&& cpanm Regexp::Grammars \
&& git submodule update --init \
&& make setup-golpe \
&& make -j4
FROM alpine:3.18.3
WORKDIR /app
RUN \
@ -41,9 +44,12 @@ RUN \
libsecp256k1 \
libb2 \
zstd \
libressl3.7-libssl \
libressl \
&& rm -rf /var/cache/apk/*
COPY --from=build /build/strfry strfry
EXPOSE 7777
ENTRYPOINT ["/app/strfry"]
CMD ["relay"]