-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
157175c
commit 3621bca
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM rust:alpine3.18 AS builder | ||
|
||
RUN USER=root cargo new --bin remini | ||
WORKDIR /remini | ||
|
||
ENV RUSTFLAGS="-C target-feature=-crt-static" | ||
RUN apk add -q --update-cache --no-cache build-base openssl-dev musl pkgconfig protobuf-dev | ||
|
||
COPY . . | ||
|
||
RUN cargo build --release | ||
|
||
FROM alpine:3.18 AS runtime | ||
|
||
RUN apk add --no-cache libgcc | ||
|
||
RUN addgroup -S appgroup && adduser -S rust -G appgroup | ||
USER rust | ||
|
||
# Copy binary. | ||
COPY --from=builder /remini/target/release/remini /bin/remini | ||
# Copy ML models. | ||
COPY --from=builder /remini/src/corpus/model.onnx /src/corpus/model.onnx | ||
|
||
EXPOSE 50051/tcp | ||
CMD ["./bin/remini"] |