From 40ae9c0dca4cb7bc94ca752c79a3c8d723e8d2a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorben=20G=C3=BCnther?= Date: Wed, 15 Mar 2023 16:51:02 +0100 Subject: [PATCH] Update Dockerfile Static assets are no longer copied into the image but instead embedded in the binary. --- Dockerfile | 18 ------------------ docker/Dockerfile | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 18 deletions(-) delete mode 100644 Dockerfile create mode 100644 docker/Dockerfile diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 448717a..0000000 --- a/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM golang:alpine as builder -LABEL stage=builder -RUN apk add --no-cache gcc libc-dev - -WORKDIR /workspace -#COPY go.mod . -#COPY go.sum . -#RUN go mod download - -COPY . . -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o faceit_go faceit.go - -FROM alpine -WORKDIR / -COPY --from=builder /workspace/faceit_go /workspace/faceit.html /workspace/player.html /workspace/error.html ./ -COPY --from=builder /workspace/css ./css -ENTRYPOINT [ "./faceit_go" ] -EXPOSE 8080 diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..e3fe3a4 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:alpine as build +WORKDIR /app +ARG VERSION=1.2.0 + +RUN wget https://git.xenrox.net/~xenrox/faceit_checker/refs/download/v${VERSION}/faceit_checker-${VERSION}.tar.gz -O latest.tar.gz && \ + tar -zxf latest.tar.gz +RUN cd faceit_checker-${VERSION} && \ + go build -o /app/faceit_checker + +FROM alpine:latest +WORKDIR / + +COPY --from=build /app/faceit_checker /faceit_checker + +ENTRYPOINT [ "./faceit_checker" ] -- 2.44.0