-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.detective
37 lines (32 loc) · 1.03 KB
/
Dockerfile.detective
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
ARG DETECTIVE_URL
ARG DATABASE_URL
ARG ALCHEMY_NODE_URL
FROM lukemathwalker/cargo-chef:latest AS chef
FROM chef AS planner
# WORKDIR /app
# COPY /apps/detective apps/detective/
# COPY /packages/database packages/database/
# WORKDIR /app/apps/detective
# RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
# COPY --from=planner /app/apps/detective/recipe.json recipe.json
# # Build dependencies - this is the caching Docker layer!
# RUN cargo chef cook --release --recipe-path recipe.json
# Build application
WORKDIR /app
COPY /apps/detective apps/detective/
COPY /packages/database packages/database/
WORKDIR /app/apps/detective
RUN rm -f ./src/prisma.rs
RUN rustup component add rustfmt
RUN cargo generate
RUN cargo fmt
RUN cargo build --release --bin detective
FROM debian:bookworm-slim AS runtime
RUN apt update
RUN apt install openssl ca-certificates -y
WORKDIR /app
COPY --from=builder /app/apps/detective/target/release/detective /usr/local/bin
ENTRYPOINT ["/usr/local/bin/detective"]
ENV ROCKET_ADDRESS=0.0.0.0
EXPOSE 8000