-
Notifications
You must be signed in to change notification settings - Fork 79
Expand file tree
/
Copy pathDockerfile.api
More file actions
36 lines (26 loc) · 1017 Bytes
/
Dockerfile.api
File metadata and controls
36 lines (26 loc) · 1017 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.7
FROM build-container-localdev AS builder
ENV CARGO_HOME=/cargo-home
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true
ENV CARGO_TARGET_DIR=/cargo-target
WORKDIR /workspace
COPY . .
RUN --mount=type=cache,id=nico-devspace-cargo-home,target=/cargo-home,sharing=locked \
--mount=type=cache,id=nico-devspace-cargo-target,target=/cargo-target,sharing=locked \
cargo build -p carbide-api --bin carbide-api --locked && \
mkdir -p /artifacts && \
cp /cargo-target/debug/carbide-api /artifacts/carbide-api
FROM ubuntu:24.04
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
curl \
ipmitool \
iproute2 \
iputils-ping \
libudev1 \
tpm2-tools \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /opt/carbide /opt/carbide/firmware /mnt/persistence /var/run/kea
COPY --from=builder /artifacts/carbide-api /opt/carbide/carbide-api
COPY crates/api/casbin-policy.csv /opt/carbide/casbin-policy.csv
ENV CASBIN_POLICY_FILE=/opt/carbide/casbin-policy.csv