mirror of
https://github.com/exchanges-lab/tradesync.git
synced 2026-08-05 05:06:07 +08:00
e82da57136
The project was renamed from nosync to tradesync, but the runtime stage still copied/ran /app/nosync, which no longer exists in target/release, breaking the image build. Point COPY and CMD at the tradesync binary. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
30 lines
824 B
Docker
30 lines
824 B
Docker
# Stage 1: Build dependency cache and compile application
|
|
FROM rust:1.95-bookworm AS builder
|
|
|
|
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Create dummy source files for caching build dependencies
|
|
COPY Cargo.toml Cargo.lock ./
|
|
RUN mkdir src && echo "fn main() {}" > src/main.rs && touch src/lib.rs
|
|
RUN cargo build --release
|
|
|
|
# Copy actual source files
|
|
COPY src ./src
|
|
# Touch files to force rebuild with real source
|
|
RUN touch src/main.rs src/lib.rs
|
|
RUN cargo build --release
|
|
|
|
# Stage 2: Minimal runtime image
|
|
FROM debian:bookworm-slim
|
|
|
|
RUN apt-get update && apt-get install -y ca-certificates openssl && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy the built binary
|
|
COPY --from=builder /app/target/release/tradesync /app/tradesync
|
|
|
|
CMD ["/app/tradesync"]
|