1FROM golang:1.25-bookworm AS builder
2
3RUN apt-get update && apt-get install -y --no-install-recommends gcc libc6-dev && rm -rf /var/lib/apt/lists/*
4
5WORKDIR /src
6
7COPY go.mod go.sum ./
8RUN go mod download
9
10COPY . .
11
12RUN CGO_ENABLED=1 go build -ldflags="-s -w" -o /out/arche-server ./cmd/arche-server
13
14FROM debian:bookworm-slim
15
16RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
17
18RUN useradd -r -u 1000 -m arche
19USER arche
20
21WORKDIR /app
22
23COPY --from=builder /out/arche-server /app/arche-server
24
25RUN mkdir -p /app/data
26
27EXPOSE 8080
28
29ENTRYPOINT ["/app/arche-server", "--config", "/app/config/server.toml"]