-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (22 loc) · 679 Bytes
/
Dockerfile
File metadata and controls
37 lines (22 loc) · 679 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
36
37
# ---------- Build stage ----------
FROM golang:1.23-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git build-base
COPY go.mod ./
COPY go.sum ./
RUN go mod download
COPY . ./
RUN CGO_ENABLED=1 GOOS=linux go build -o /app/webhookhub ./cmd/webhookhub
RUN chmod +x /app/webhookhub
# ---------- Final stage ----------
FROM alpine:latest
RUN apk add --no-cache ca-certificates \
&& addgroup -S appgroup \
&& adduser -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /app/webhookhub /app/webhookhub
COPY --from=builder /app/web /app/web
RUN mkdir data && chown -R appuser:appgroup /app
USER appuser:appgroup
EXPOSE 8080
ENTRYPOINT ["/app/webhookhub"]