2023-05-19 17:34:06 -07:00
|
|
|
FROM const-gen AS const-export
|
2022-04-02 06:30:40 -07:00
|
|
|
# This is a multi-stage docker file:
|
|
|
|
# 1. The first stage builds the contracts
|
|
|
|
# 2. The second is an empty image with only the wasm files (useful for exporting)
|
2023-12-13 08:27:17 -08:00
|
|
|
FROM cosmwasm/workspace-optimizer:0.15.0@sha256:e1ba559282ea88cedeb67dd6dd541ad57d1b75c2fb1ce5f476d423458da91b4d AS builder
|
2022-02-11 20:01:11 -08:00
|
|
|
COPY Cargo.lock /code/
|
|
|
|
COPY Cargo.toml /code/
|
|
|
|
COPY contracts /code/contracts
|
2022-02-28 12:48:50 -08:00
|
|
|
|
2023-12-13 08:27:17 -08:00
|
|
|
RUN --mount=type=cache,target=/target,id=terra_classic_target --mount=type=cache,target=/usr/local/cargo/registry optimize.sh .
|
2020-12-03 05:37:23 -08:00
|
|
|
|
2022-04-02 06:30:40 -07:00
|
|
|
FROM scratch as artifacts
|
|
|
|
COPY --from=builder /code/artifacts /
|
|
|
|
|
2020-12-03 05:37:23 -08:00
|
|
|
# Contract deployment stage
|
2021-10-04 04:52:11 -07:00
|
|
|
FROM node:16-buster-slim@sha256:93c9fc3550f5f7d159f282027228e90e3a7f8bf38544758024f005e82607f546
|
2020-12-03 05:37:23 -08:00
|
|
|
|
2021-07-05 04:17:07 -07:00
|
|
|
RUN apt update && apt install netcat curl jq -y
|
2020-12-03 05:37:23 -08:00
|
|
|
|
|
|
|
WORKDIR /app/tools
|
|
|
|
|
2022-04-02 06:30:40 -07:00
|
|
|
COPY --from=artifacts / /app/artifacts
|
2022-02-11 20:01:11 -08:00
|
|
|
COPY ./artifacts/cw20_base.wasm /app/artifacts/
|
|
|
|
|
|
|
|
COPY ./tools/package.json ./tools/package-lock.json /app/tools/
|
|
|
|
RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
|
|
|
|
npm ci
|
|
|
|
COPY ./tools /app/tools
|
2023-05-19 17:34:06 -07:00
|
|
|
COPY --from=const-export .env /app/tools/.env
|