-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile.backend
68 lines (56 loc) · 2.59 KB
/
Dockerfile.backend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
ARG FRONTEND_APP
ARG downloader=${FRONTEND_APP}_${TARGETARCH}_downloader
FROM scratch AS mmseqs_amd64_downloader
WORKDIR /opt/build
ONBUILD ADD https://mmseqs.com/latest/mmseqs-linux-avx2.tar.gz .
ONBUILD ADD https://mmseqs.com/latest/mmseqs-linux-sse41.tar.gz .
ONBUILD ADD https://mmseqs.com/latest/mmseqs-linux-sse2.tar.gz .
FROM scratch AS mmseqs_arm64_downloader
WORKDIR /opt/build
ONBUILD ADD https://mmseqs.com/latest/mmseqs-linux-arm64.tar.gz .
FROM scratch AS foldseek_amd64_downloader
WORKDIR /opt/build
ONBUILD ADD https://mmseqs.com/foldseek/foldseek-linux-avx2.tar.gz .
#ONBUILD ADD https://mmseqs.com/foldseek/foldseek-linux-sse41.tar.gz .
ONBUILD ADD https://mmseqs.com/foldseek/foldseek-linux-sse2.tar.gz .
ONBUILD ADD https://mmseqs.com/foldmason/foldmason-linux-avx2.tar.gz .
ONBUILD ADD https://mmseqs.com/foldmason/foldmason-linux-sse2.tar.gz .
FROM scratch AS foldseek_arm64_downloader
WORKDIR /opt/build
ONBUILD ADD https://mmseqs.com/foldseek/foldseek-linux-arm64.tar.gz .
ONBUILD ADD https://mmseqs.com/foldmason/foldmason-linux-arm64.tar.gz .
FROM $downloader AS downloader
FROM --platform=$BUILDPLATFORM golang:latest AS builder
ARG TARGETARCH
ARG FRONTEND_APP
WORKDIR /opt/build
ADD backend .
RUN GOOS=linux GOARCH=$TARGETARCH go build -o mmseqs-web
ADD https://raw.githubusercontent.com/soedinglab/MMseqs2/678c82ac44f1178bf9a3d49bfab9d7eed3f17fbc/util/mmseqs_wrapper.sh binaries/mmseqs
ADD https://raw.githubusercontent.com/steineggerlab/foldseek/0a68e16214a6db745cee783128ccba8546ea5dc9/util/foldseek_wrapper.sh binaries/foldseek
COPY --from=downloader /opt/build/* .
RUN mkdir binaries; \
if [ "$TARGETARCH" = "arm64" ]; then \
for i in mmseqs foldseek foldmason; do \
if [ -e "${i}-linux-arm64.tar.gz" ]; then \
cat ${i}-linux-arm64.tar.gz | tar -xzvf- ${i}/bin/${i}; \
mv -f -- ${i}/bin/${i} binaries/${i}; \
fi; \
done; \
else \
for i in mmseqs foldseek foldmason; do \
for j in sse2 sse41 avx2; do \
if [ -e "${i}-linux-${j}.tar.gz" ]; then \
cat ${i}-linux-${j}.tar.gz | tar -xzvf- ${i}/bin/${i}; \
mv -f -- ${i}/bin/${i} binaries/${i}_${j}; \
fi; \
done; \
done; \
sed 's|foldseek|foldmason|g' binaries/foldseek > binaries/foldmason; \
fi; \
chmod -R +x binaries;
FROM debian:stable-slim
LABEL maintainer="Milot Mirdita <[email protected]>"
RUN apt-get update && apt-get install -y ca-certificates wget aria2 && rm -rf /var/lib/apt/lists/*
COPY --from=builder /opt/build/mmseqs-web /opt/build/binaries/* /usr/local/bin/
ENTRYPOINT ["/usr/local/bin/mmseqs-web"]