Docker
Some checks failed
Go / build (push) Failing after 25s

This commit is contained in:
2023-10-27 11:40:19 +13:00
parent e56a541a40
commit 15a7690e36
2 changed files with 54 additions and 12 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# syntax=docker/dockerfile:1
FROM golang:alpine AS builder
ENV VERSION 0.1.0
ENV CGO_ENABLED 0
ENV GOOS linux
ENV BUILD_DIR /build
RUN mkdir -p ${BUILD_DIR}
WORKDIR ${BUILD_DIR}
RUN adduser --system --no-create-home --uid 1000 --shell /sbin/nologin app
COPY go.* ./
COPY *.go ./
RUN go build -v -o / ./...
FROM scratch
USER app
EXPOSE 3000
HEALTHCHECK --timeout=3s CMD /snice healthcheck
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /snice /
ENTRYPOINT ["/snice"]
CMD ["serve"]