2022-10-25 08:52:54 +00:00
|
|
|
# syntax=docker/dockerfile-upstream:master-labs
|
2022-07-16 16:58:22 +00:00
|
|
|
FROM node:16.16.0-alpine3.15 AS builder
|
2022-10-25 08:52:54 +00:00
|
|
|
|
|
|
|
RUN apk add git subversion rsync
|
2021-07-07 20:45:37 +00:00
|
|
|
WORKDIR /otterscan-build
|
2021-07-11 02:22:17 +00:00
|
|
|
COPY ["package.json", "package-lock.json", "/otterscan-build/"]
|
2021-07-07 20:45:37 +00:00
|
|
|
RUN npm install
|
2022-10-25 08:52:54 +00:00
|
|
|
COPY ["tsconfig.json", "tsconfig.node.json", "postcss.config.js", "tailwind.config.js", "vite.config.ts", "index.html", "/otterscan-build/"]
|
2021-07-11 02:22:17 +00:00
|
|
|
COPY ["public", "/otterscan-build/public/"]
|
|
|
|
COPY ["src", "/otterscan-build/src/"]
|
2022-10-25 08:52:54 +00:00
|
|
|
RUN npm run fullbuild
|
2021-07-07 20:45:37 +00:00
|
|
|
|
2022-02-26 03:17:24 +00:00
|
|
|
FROM alpine:3.15.0 AS logobuilder
|
2022-10-25 08:52:54 +00:00
|
|
|
RUN apk add imagemagick parallel subversion git
|
|
|
|
WORKDIR /
|
|
|
|
ADD https://github.com/trustwallet/assets.git /trustwallet
|
|
|
|
RUN mkdir -p /assets/
|
|
|
|
RUN mv /trustwallet/blockchains/ethereum/assets /assets/1/
|
|
|
|
RUN mv /trustwallet/blockchains/polygon/assets /assets/137/
|
|
|
|
RUN mv /trustwallet/blockchains/smartchain/assets /assets/56/
|
2022-02-26 00:52:54 +00:00
|
|
|
RUN find . -name logo.png | parallel magick convert {} -filter Lanczos -resize 32x32 {}; exit 0
|
2021-07-10 00:11:52 +00:00
|
|
|
|
2021-10-20 18:44:27 +00:00
|
|
|
# Add brotli module to official nginx image
|
|
|
|
# Based on: https://github.com/nginxinc/docker-nginx/tree/master/modules
|
2022-10-25 08:52:54 +00:00
|
|
|
FROM golang:1.19-alpine as gobuilder
|
|
|
|
RUN apk add alpine-sdk
|
|
|
|
|
|
|
|
WORKDIR /wd
|
|
|
|
COPY ["go.mod","go.sum","/wd/"]
|
|
|
|
COPY cmd cmd
|
2022-10-25 10:20:17 +00:00
|
|
|
RUN go build -o otter ./cmd/otter
|
2022-10-25 08:52:54 +00:00
|
|
|
|
|
|
|
FROM alpine:3.15.0
|
|
|
|
RUN apk add alpine-sdk
|
|
|
|
WORKDIR /wd
|
2022-10-25 10:20:17 +00:00
|
|
|
COPY --from=gobuilder /wd/otter /usr/bin/otter
|
2022-10-25 08:52:54 +00:00
|
|
|
COPY --from=builder /otterscan-build/dist /wd/dist
|
|
|
|
COPY --from=logobuilder /assets /wd/dist
|
|
|
|
|
|
|
|
CMD ["server"]
|