-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.mst2
More file actions
47 lines (39 loc) · 1.61 KB
/
Copy pathDockerfile.mst2
File metadata and controls
47 lines (39 loc) · 1.61 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# mega2 with the MST/2 snapshot surface, for the compose acceptance stacks.
#
# The build context is this repository alone: the shared codec is a registry
# dependency (see Cargo.toml), so no sibling checkout or extra build context is
# needed. The registry version (0.3) carries the MTP2 route walk and the
# spec-conformance zstd fixes.
FROM rust:1.97-bookworm AS builder
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
clang \
cmake \
curl \
git \
libssl-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src/monoengine
COPY . /src/monoengine
ARG TARGETARCH
RUN --mount=type=cache,target=/usr/local/cargo/registry,id=monoengine-it-cargo-registry-${TARGETARCH},sharing=locked \
--mount=type=cache,target=/usr/local/cargo/git,id=monoengine-it-cargo-git-${TARGETARCH},sharing=locked \
--mount=type=cache,target=/src/monoengine/target,id=monoengine-it-target-${TARGETARCH},sharing=locked \
cargo build --release -p mega2 \
&& install -D -m0755 /src/monoengine/target/release/mega2 /out/mega2
FROM debian:bookworm-slim AS runtime
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
curl \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /out/mega2 /usr/local/bin/mega2
COPY config/config.toml /etc/mega2/config.toml
ENV MEGA_BASE_DIR=/var/lib/mega2 \
MEGA_CONFIG=/etc/mega2/config.toml
EXPOSE 8000
ENTRYPOINT ["/usr/local/bin/mega2"]
CMD ["--config", "/etc/mega2/config.toml", "service", "http", "--host", "0.0.0.0", "-p", "8000"]