-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
30 lines (26 loc) · 989 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
30
FROM lukemathwalker/cargo-chef:latest-rust-1.72.0 AS chef
WORKDIR /app
FROM chef as planner
COPY . .
RUN cargo chef prepare --recipe-path chef-recipe.json
FROM chef as builder
# Kind of unfortunate, but we must copy this local dependency until it's properly released
COPY --from=planner /app/tir-engine tir-engine
COPY --from=planner /app/chef-recipe.json chef-recipe.json
RUN cargo chef cook --release --recipe-path chef-recipe.json
COPY . .
RUN apt-get update -y && apt-get install -y --no-install-recommends protobuf-compiler
RUN cargo build --release
FROM ubuntu:22.04 as runtime
ARG PORT=50051
ARG OPENAI_SK
WORKDIR /app
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends wget ca-certificates openssl \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/tir-engine-grpc /usr/local/bin
ENV PORT $PORT
ENV OPENAI_SK $OPENAI_SK
ENTRYPOINT ["/usr/local/bin/tir-engine-grpc"]