-
-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (30 loc) · 954 Bytes
/
Copy pathDockerfile
File metadata and controls
35 lines (30 loc) · 954 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
FROM rust:alpine3.24 AS chef
RUN apk add --no-cache musl-dev gcc openssl-dev openssl-libs-static pkgconfig openjdk25
RUN rustup toolchain install stable
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
# Build dependencies
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
# Build app
COPY . .
RUN cargo build --release
RUN strip target/release/temper
# Minimal runtime
FROM alpine:3.20
WORKDIR /app
RUN addgroup -S temper && adduser -S temper -G temper
COPY --from=builder /app/target/release/temper /app/
RUN ./temper setup
RUN chown -R temper:temper /app
LABEL org.opencontainers.image.source = "https://github.com/temper-mc/temper"
USER temper
EXPOSE 25565
EXPOSE 9000
HEALTHCHECK --interval=30s --timeout=3s --start-period=40s \
CMD nc -z localhost 25565 || exit 1
CMD ["./temper", "--no-tui"]