~xenrox/faceit_checker

40ae9c0dca4cb7bc94ca752c79a3c8d723e8d2a6 — Thorben Günther 1 year, 1 month ago 4e58a86
Update Dockerfile

Static assets are no longer copied into the image but instead embedded
in the binary.
2 files changed, 15 insertions(+), 18 deletions(-)

D Dockerfile
A docker/Dockerfile
D Dockerfile => Dockerfile +0 -18
@@ 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

A docker/Dockerfile => docker/Dockerfile +15 -0
@@ 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" ]