Eric Bower
·
2025-10-26
Dockerfile
1FROM --platform=$BUILDPLATFORM golang:1.24 AS builder-deps
2LABEL maintainer="Pico Maintainers <hello@pico.sh>"
3
4WORKDIR /app
5
6RUN apt-get update
7RUN apt-get install -y git ca-certificates
8
9RUN git clone https://codeberg.org/emersion/soju.git
10
11# COPY subscriber-change.diff .
12
13WORKDIR /app/soju
14
15RUN git checkout v0.9.0
16
17# RUN git apply ../subscriber-change.diff
18
19RUN --mount=type=cache,target=/go/pkg/,rw \
20 --mount=type=cache,target=/root/.cache/,rw \
21 go mod download
22
23FROM builder-deps AS builder
24
25COPY . .
26
27ARG APP=prose
28ARG TARGETOS
29ARG TARGETARCH
30
31ENV CGO_ENABLED=0
32ENV GOFLAGS="-tags=moderncsqlite"
33ENV LDFLAGS="-s -w"
34
35ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH}
36
37RUN --mount=type=cache,target=/go/pkg/,rw \
38 --mount=type=cache,target=/root/.cache/,rw \
39 go build -ldflags "$LDFLAGS" ./cmd/soju
40
41RUN --mount=type=cache,target=/go/pkg/,rw \
42 --mount=type=cache,target=/root/.cache/,rw \
43 go build -ldflags "$LDFLAGS" ./cmd/sojuctl
44
45FROM scratch
46
47WORKDIR /app
48
49COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
50COPY --from=builder /app/soju/soju .
51COPY --from=builder /app/soju/sojuctl .
52
53COPY soju.config .
54COPY motd.txt .
55
56EXPOSE 6697
57EXPOSE 8080
58
59ENTRYPOINT ["/app/soju", "-config", "/app/soju.config"]