26 lines
418 B
Docker
26 lines
418 B
Docker
# Build stage
|
|
FROM golang:1.21-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY main.go ./
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o nats-ui main.go
|
|
|
|
# Runtime stage
|
|
FROM alpine:3.19
|
|
|
|
RUN apk --no-cache add ca-certificates tzdata
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /app/nats-ui .
|
|
COPY index.html config.yaml ./
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["./nats-ui"]
|
|
CMD ["config.yaml"]
|