forked from NSPG13/agent-bounties
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 991 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (27 loc) · 991 Bytes
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
# syntax=docker/dockerfile:1
ARG RUST_VERSION=1.94
FROM rust:${RUST_VERSION}-bookworm AS builder
WORKDIR /workspace
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY contracts ./contracts
COPY fixtures ./fixtures
COPY migrations ./migrations
COPY schemas ./schemas
COPY site ./site
ARG APP_PACKAGE=api
ARG APP_BINARY=api
RUN --mount=type=cache,target=/usr/local/cargo/registry,sharing=locked \
--mount=type=cache,target=/workspace/target,sharing=locked \
cargo build --locked --release -p "${APP_PACKAGE}" \
&& cp "target/release/${APP_BINARY}" /tmp/agent-bounties-service
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates curl \
&& rm -rf /var/lib/apt/lists/*
RUN useradd --create-home --uid 10001 app
COPY --from=builder /tmp/agent-bounties-service /usr/local/bin/agent-bounties-service
USER app
ENV RUST_LOG=info
EXPOSE 8080 8090
ENTRYPOINT ["/usr/local/bin/agent-bounties-service"]