repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
e04a2e1
parent
7e8bd93
author
Eric Bower
date
2024-11-07 18:21:58 +0000 UTC
fix(bouncer): previous alpine docker was failing to build
2 files changed,  +33, -9
M bouncer/Dockerfile
+31, -7
 1@@ -1,8 +1,10 @@
 2-FROM golang:1.23-alpine AS builder
 3+FROM --platform=$BUILDPLATFORM golang:1.23 AS builder-deps
 4+LABEL maintainer="Pico Maintainers <hello@pico.sh>"
 5 
 6 WORKDIR /app
 7 
 8-RUN apk add --no-cache git sqlite-libs sqlite-dev build-base
 9+RUN apt-get update
10+RUN apt-get install -y git ca-certificates
11 
12 RUN git clone https://codeberg.org/emersion/soju.git
13 
14@@ -12,20 +14,42 @@ WORKDIR /app/soju
15 
16 RUN git apply ../subscriber-change.diff
17 
18-ENV LDFLAGS="-linkmode external -extldflags -static"
19+RUN --mount=type=cache,target=/go/pkg/,rw \
20+  --mount=type=cache,target=/root/.cache/,rw \
21+  go mod download
22+
23+FROM builder-deps AS builder
24+
25+COPY . .
26+
27+ARG APP=prose
28+ARG TARGETOS
29+ARG TARGETARCH
30+
31+ENV CGO_ENABLED=0
32 ENV GOFLAGS="-tags=moderncsqlite"
33+ENV LDFLAGS="-s -w"
34+
35+ENV GOOS=${TARGETOS} GOARCH=${TARGETARCH}
36 
37-RUN go build -ldflags "$LDFLAGS" ./cmd/soju
38-RUN go build -ldflags "$LDFLAGS" ./cmd/sojuctl
39+RUN --mount=type=cache,target=/go/pkg/,rw \
40+  --mount=type=cache,target=/root/.cache/,rw \
41+  go build -ldflags "$LDFLAGS" ./cmd/soju
42 
43-FROM alpine
44+RUN --mount=type=cache,target=/go/pkg/,rw \
45+  --mount=type=cache,target=/root/.cache/,rw \
46+  go build -ldflags "$LDFLAGS" ./cmd/sojuctl
47+
48+FROM scratch
49 
50 WORKDIR /app
51 
52-COPY soju.config .
53+COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
54 COPY --from=builder /app/soju/soju .
55 COPY --from=builder /app/soju/sojuctl .
56 
57+COPY soju.config .
58+
59 EXPOSE 6697
60 EXPOSE 8080
61 
M docker-compose.yml
+2, -2
 1@@ -121,14 +121,14 @@ services:
 2       - services
 3       - all
 4   auth-web:
 5-    image: ghcr.io/picosh/pico/auth-web:main
 6+    image: ghcr.io/picosh/pico/auth-web:latest
 7     restart: always
 8     profiles:
 9       - auth
10       - services
11       - all
12   bouncer:
13-    image: ghcr.io/picosh/pico/bouncer:main
14+    image: ghcr.io/picosh/pico/bouncer:latest
15     restart: always
16     profiles:
17       - bouncer