-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (19 loc) · 772 Bytes
/
Dockerfile
File metadata and controls
29 lines (19 loc) · 772 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
FROM golang:1.26-alpine AS builder
RUN apk add --no-cache libstdc++ libgcc
WORKDIR /app
# Download platform-appropriate Tailwind CSS standalone CLI
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ]; then TWARCH="arm64"; else TWARCH="x64"; fi && \
wget -qO /usr/local/bin/tailwindcss "https://github.com/tailwindlabs/tailwindcss/releases/download/v4.2.2/tailwindcss-linux-${TWARCH}-musl" && \
chmod +x /usr/local/bin/tailwindcss
COPY go.mod go.sum ./
RUN go mod download
COPY . .
# Build CSS from templates
RUN tailwindcss -i input.css -o cmd/server/static/styles.css --minify
RUN CGO_ENABLED=0 GOOS=linux go build -o /hooks ./cmd/server
FROM alpine:3.21
RUN apk --no-cache add ca-certificates
COPY --from=builder /hooks /hooks
EXPOSE 8080
CMD ["/hooks"]