-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
29 lines (20 loc) · 822 Bytes
/
Dockerfile
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
# Use the official Rust image as the base image
FROM rust:latest AS builder
# Set the working directory inside the container
WORKDIR /usr/src/app
# Copy the Cargo.toml and Cargo.lock files to the container
COPY Cargo.toml Cargo.lock ./
# Create a dummy main.rs to build dependencies
RUN mkdir src && echo "fn main() {}" > src/main.rs
# Build the dependencies
RUN cargo build --release && rm -rf src
# Copy the source code to the container
COPY . .
# Build the application
RUN cargo build --release
# Use a minimal base image for the final stage
FROM debian:buster-slim
# Copy the compiled binary from the builder stage
COPY --from=builder /usr/src/app/target/release/audioprocess_cuda_rust /usr/local/bin/audioprocess_cuda_rust
# Set the entrypoint to the application binary
ENTRYPOINT ["audioprocess_cuda_rust"]