-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (32 loc) · 1.08 KB
/
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef
FROM node:latest AS node
FROM debian:bookworm-slim AS base
FROM node AS frontal-deps
WORKDIR /app/frontal
COPY frontal/package.json frontal/package-lock.json* ./
RUN npm ci
FROM node AS frontal-builder
ENV NEXT_PUBLIC_APP_MODE=production
WORKDIR /app/frontal
COPY frontal .
COPY --from=frontal-deps /app/frontal/node_modules ./node_modules
RUN npx next build
FROM chef AS parietal-deps
WORKDIR /app/parietal
COPY ./parietal .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS parietal-builder
WORKDIR /app/parietal
COPY --from=parietal-deps /app/parietal/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY ./parietal .
COPY --from=frontal-builder /app/frontal/out /app/frontal/out
RUN cargo build --release
FROM base AS final
WORKDIR /app
COPY --from=parietal-builder /app/parietal/target/release/parietal /app/parietal
ENV TINI_VERSION v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
CMD ["/app/parietal"]