|
| 1 | +FROM oven/bun:1-alpine AS builder |
| 2 | +LABEL maintainer="hello@acala.network" |
| 3 | + |
| 4 | +WORKDIR /app |
| 5 | + |
| 6 | +# required to build some native deps |
| 7 | +RUN apk add git python3 make gcc g++ musl-dev py3-pip |
| 8 | +RUN pip3 install --break-system-packages setuptools wheel |
| 9 | + |
| 10 | +# required by some legacy deps |
| 11 | +RUN unlink /usr/bin/python && \ |
| 12 | + ln -s /usr/bin/python3 /usr/bin/python && \ |
| 13 | + ln -sf /usr/bin/pip3 /usr/bin/pip |
| 14 | + |
| 15 | +COPY packages/acala-evm-transfer/package.json packages/acala-evm-transfer/bun.lock ./ |
| 16 | +RUN bun install |
| 17 | +COPY packages/acala-evm-transfer/ ./ |
| 18 | +RUN set -e \ |
| 19 | + && rm -rf /app/dist \ |
| 20 | + && ./node_modules/.bin/subql codegen \ |
| 21 | + && ./node_modules/.bin/subql build --output dist \ |
| 22 | + && for i in 1 2 3 4 5; do [ -d /app/dist ] && break; sleep 1; done \ |
| 23 | + && if [ ! -d /app/dist ]; then \ |
| 24 | + echo "SubQL build did not create /app/dist"; \ |
| 25 | + find /app -maxdepth 2 -type d -name dist -print; \ |
| 26 | + find /app -maxdepth 2 -type f \( -name 'index.js' -o -name 'index.js.LICENSE.txt' \) -print; \ |
| 27 | + exit 1; \ |
| 28 | + fi \ |
| 29 | + && ls -la /app/dist \ |
| 30 | + && echo "Build completed successfully" |
| 31 | + |
| 32 | +# ============= |
| 33 | + |
| 34 | +FROM subquerynetwork/subql-node-ethereum:v6.5.0 |
| 35 | +LABEL maintainer="hello@acala.network" |
| 36 | + |
| 37 | +# subql node changed default user to USER 1000 |
| 38 | +USER root |
| 39 | + |
| 40 | +WORKDIR /app |
| 41 | + |
| 42 | +COPY --from=builder /app/package.json /app/ |
| 43 | +COPY --from=builder /app/schema.graphql /app/ |
| 44 | +COPY --from=builder /app/dist /app/dist |
| 45 | +COPY --from=builder /app/project.yaml /app/ |
| 46 | +COPY --from=builder /app/abis /app/abis |
| 47 | + |
| 48 | +RUN chown -R 1000:1000 /app |
| 49 | + |
| 50 | +USER 1000 |
| 51 | + |
| 52 | +EXPOSE 3000 |
0 commit comments