forked from koryxio/koryx-serv
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (25 loc) · 852 Bytes
/
Dockerfile
File metadata and controls
38 lines (25 loc) · 852 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
38
# Build stage
FROM golang:1.26-alpine3.23 AS builder
RUN apk add --no-cache git make
WORKDIR /app
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w -X main.version=docker" -o koryx-serv ./cmd/koryx-serv
# Runtime stage
FROM alpine:3.23
RUN apk update && \
apk upgrade --no-cache && \
apk --no-cache add ca-certificates tzdata
RUN addgroup -g 1000 koryx-serv && \
adduser -D -u 1000 -G koryx-serv koryx-serv
WORKDIR /app
COPY --from=builder /app/koryx-serv /app/koryx-serv
RUN mkdir -p /app/public && \
chown -R koryx-serv:koryx-serv /app
USER koryx-serv
EXPOSE 8080
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:8080/ || exit 1
ENTRYPOINT ["/app/koryx-serv"]
CMD ["-dir", "/app/public"]