forked from StellarLock/StellarLock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.contracts
More file actions
41 lines (34 loc) · 1.63 KB
/
Copy pathDockerfile.contracts
File metadata and controls
41 lines (34 loc) · 1.63 KB
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
# ── StellarLock — contracts build/test Dockerfile ────────────────────────────
#
# Provides a reproducible Rust + Soroban CLI environment for building and
# testing the on-chain contracts without requiring a local Rust toolchain.
#
# Usage (via docker-compose):
# docker-compose run contracts build
# docker-compose run contracts test
#
# Usage standalone:
# docker build -f Dockerfile.contracts -t stellarlock-contracts .
# docker run -v $(pwd)/contracts:/app/contracts stellarlock-contracts build
FROM rust:1.82-slim AS base
# Install build essentials and Stellar CLI
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
pkg-config \
libssl-dev \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Add the wasm32 target required by Soroban
RUN rustup target add wasm32v1-none
# Install the Stellar CLI (pinned version for reproducibility).
# ⚠️ Keep this version in sync with the `stellar/stellar-cli` action version
# used in .github/workflows/ci.yml (contracts job) — currently v27.0.0.
RUN cargo install --locked stellar-cli@27.0.0 --features opt
WORKDIR /app
# ── Runtime ───────────────────────────────────────────────────────────────────
# The contracts directory is mounted as a volume at runtime.
VOLUME ["/app/contracts"]
# Default command: build contracts
# Override with: docker-compose run contracts test
ENTRYPOINT ["sh", "-c"]
CMD ["cd contracts && stellar contract build"]