Skip to content

Commit

Permalink
chore: add dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
RealHinome authored Dec 27, 2023
1 parent 157175c commit 3621bca
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Dockerfile
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"]

0 comments on commit 3621bca

Please sign in to comment.