Dockerfile 1.1 KB

1234567891011121314151617181920212223242526272829
  1. FROM const-gen AS const-export
  2. # This is a multi-stage docker file:
  3. # 1. The first stage builds the contracts
  4. # 2. The second is an empty image with only the wasm files (useful for exporting)
  5. FROM cosmwasm/workspace-optimizer:0.15.0@sha256:e1ba559282ea88cedeb67dd6dd541ad57d1b75c2fb1ce5f476d423458da91b4d AS builder
  6. COPY Cargo.lock /code/
  7. COPY Cargo.toml /code/
  8. COPY contracts /code/contracts
  9. RUN --mount=type=cache,target=/target,id=terra_classic_target --mount=type=cache,target=/usr/local/cargo/registry optimize.sh .
  10. FROM scratch as artifacts
  11. COPY --from=builder /code/artifacts /
  12. # Contract deployment stage
  13. FROM node:22.16-bullseye-slim@sha256:550b434f7edc3a1875860657a3e306752358029c957280809ae6395ab296faeb
  14. RUN apt update && apt install netcat curl jq -y
  15. WORKDIR /app/tools
  16. COPY --from=artifacts / /app/artifacts
  17. COPY ./artifacts/cw20_base.wasm /app/artifacts/
  18. COPY ./tools/package.json ./tools/package-lock.json /app/tools/
  19. RUN --mount=type=cache,uid=1000,gid=1000,target=/home/node/.npm \
  20. npm ci
  21. COPY ./tools /app/tools
  22. COPY --from=const-export .env /app/tools/.env