diff --git a/.github/workflows/rust.yaml b/.github/workflows/rust.yaml index e631155..b37156a 100644 --- a/.github/workflows/rust.yaml +++ b/.github/workflows/rust.yaml @@ -16,6 +16,6 @@ jobs: - name: Check-out code uses: actions/checkout@v2 - name: Build image - run: docker build -t agent . + run: docker build -f integration-tests/Dockerfile -t agent . - name: Run tests run: docker run -v $PWD:/agent agent ./tests.sh diff --git a/Cargo.lock b/Cargo.lock index 4f5de11..f49e94e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3400,7 +3400,7 @@ dependencies = [ [[package]] name = "pyth-agent" -version = "2.12.0" +version = "2.12.1" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 6ef8643..1393f69 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyth-agent" -version = "2.12.0" +version = "2.12.1" edition = "2021" [[bin]] diff --git a/Dockerfile b/Dockerfile index d674e64..08cc713 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,21 +1,17 @@ -FROM python:3.10-slim-bullseye +FROM rust:slim-bookworm as builder -# Install Rust -RUN apt update && apt install -y curl pkg-config libssl-dev build-essential -RUN curl https://sh.rustup.rs -sSf | bash -s -- -y -ENV PATH="/root/.cargo/bin:${PATH}" -RUN rustup toolchain install nightly - -# Install poetry -RUN pip install poetry -ENV PATH="${PATH}:/root/.local/bin" -RUN poetry config virtualenvs.in-project true - -# Install Solana Tool Suite -RUN sh -c "$(curl -sSfL https://release.solana.com/v1.14.17/install)" -ENV PATH="${PATH}:/root/.local/share/solana/install/active_release/bin" +RUN apt update && apt install -y curl libssl-dev pkg-config && apt clean all ADD . /agent WORKDIR /agent RUN cargo build --release + +FROM debian:12-slim + +RUN apt update && apt install -y libssl-dev && apt clean all + +COPY --from=builder /agent/target/release/agent /agent/ +COPY --from=builder /agent/config/* /agent/config/ + +ENTRYPOINT ["/agent/agent"] diff --git a/agent.Dockerfile b/agent.Dockerfile deleted file mode 100644 index 08cc713..0000000 --- a/agent.Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM rust:slim-bookworm as builder - -RUN apt update && apt install -y curl libssl-dev pkg-config && apt clean all - -ADD . /agent -WORKDIR /agent - -RUN cargo build --release - -FROM debian:12-slim - -RUN apt update && apt install -y libssl-dev && apt clean all - -COPY --from=builder /agent/target/release/agent /agent/ -COPY --from=builder /agent/config/* /agent/config/ - -ENTRYPOINT ["/agent/agent"]