16 lines
433 B
Docker
16 lines
433 B
Docker
# Development stage for Rust API
|
|
FROM rust:latest AS builder
|
|
WORKDIR /usr/src/app
|
|
COPY . .
|
|
RUN cargo install cargo-watch
|
|
RUN cargo build --release
|
|
|
|
# Runtime stage for development
|
|
FROM rust:latest
|
|
WORKDIR /usr/src/app
|
|
COPY --from=builder /usr/src/app/target/release/api_rust /usr/local/bin/api_rust
|
|
COPY --from=builder /usr/local/cargo/bin/cargo-watch /usr/local/bin/cargo-watch
|
|
COPY . .
|
|
EXPOSE 9552
|
|
CMD ["cargo-watch", "-x", "run"]
|