17 lines
399 B
Docker
17 lines
399 B
Docker
# Use the official Rust image as the base image
|
|
FROM rust:latest
|
|
|
|
# Set the working directory inside the container
|
|
WORKDIR /usr/src/app
|
|
|
|
# Copy the Cargo.toml and Cargo.lock files
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
# Copy the source code
|
|
COPY src ./src
|
|
|
|
# Install dependencies and build the application
|
|
RUN cargo build --release
|
|
|
|
# Set the command to run the application
|
|
CMD ["./target/release/backend"] |