mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
update hub dockerfile
This commit is contained in:
@@ -6,26 +6,29 @@ WORKDIR /app
|
|||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download
|
RUN go mod download
|
||||||
|
|
||||||
|
# Copy source files
|
||||||
COPY *.go ./
|
COPY *.go ./
|
||||||
COPY migrations ./migrations
|
COPY migrations ./migrations
|
||||||
|
COPY site/dist ./site/dist
|
||||||
|
COPY site/*.go ./site
|
||||||
|
|
||||||
|
RUN apk add --no-cache \
|
||||||
|
unzip \
|
||||||
|
ca-certificates
|
||||||
|
|
||||||
|
RUN update-ca-certificates
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
ARG TARGETOS TARGETARCH
|
ARG TARGETOS TARGETARCH
|
||||||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel .
|
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /beszel .
|
||||||
|
|
||||||
# ? -------------------------
|
# ? -------------------------
|
||||||
FROM alpine:latest
|
FROM scratch
|
||||||
|
|
||||||
RUN apk add --no-cache \
|
|
||||||
unzip \
|
|
||||||
ca-certificates
|
|
||||||
|
|
||||||
COPY --from=builder /beszel /
|
COPY --from=builder /beszel /
|
||||||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
||||||
|
|
||||||
COPY ./site/dist /site/dist
|
EXPOSE 8090
|
||||||
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
ENTRYPOINT [ "/beszel" ]
|
ENTRYPOINT [ "/beszel" ]
|
||||||
|
CMD ["serve", "--http=0.0.0.0:8090"]
|
||||||
CMD ["serve", "--http=0.0.0.0:8080"]
|
|
Reference in New Issue
Block a user