-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.Dockerfile
More file actions
29 lines (27 loc) · 1.08 KB
/
dev.Dockerfile
File metadata and controls
29 lines (27 loc) · 1.08 KB
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
FROM lukemathwalker/cargo-chef:0.1.71-rust-1.87.0-slim-bookworm AS chef
RUN apt-get update && apt-get install -y wget unzip && \
wget https://github.com/protocolbuffers/protobuf/releases/download/v26.1/protoc-26.1-linux-x86_64.zip && \
unzip protoc-26.1-linux-x86_64.zip -d /usr/local && \
rm protoc-26.1-linux-x86_64.zip
RUN apt-get install -y libssl-dev pkg-config libpq-dev
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
WORKDIR /app/server-ext
RUN cargo chef prepare --recipe-path recipe.json
WORKDIR /app/server-ext/client-ext
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS dev
COPY --from=planner /app/recipe.json /app/
COPY --from=planner /app/server-ext/recipe.json /app/server-ext/
COPY --from=planner /app/server-ext/client-ext/recipe.json /app/server-ext/client-ext/
WORKDIR /app/server-ext/client-ext
RUN cargo chef cook --recipe-path recipe.json
WORKDIR /app/server-ext
RUN cargo chef cook --recipe-path recipe.json
WORKDIR /app
RUN cargo chef cook --recipe-path recipe.json
COPY . /app
WORKDIR /app/
CMD ["cargo", "run"]