# syntax=docker/dockerfile:1 ## ## Build ## FROM golang:1.18-alpine AS build RUN apk update RUN apk upgrade RUN apk add build-base git WORKDIR /app COPY ./ ./ RUN go mod tidy RUN mkdir bin WORKDIR /app/whiteboxservice RUN go build -o /app/bin/wbx ## ## Deploy ## FROM golang:1.18-alpine WORKDIR / COPY ./whiteboxservice/assets /assets COPY ./whiteboxservice/templates /templates COPY ./whiteboxservice/bin /bin COPY --from=build /app/bin/wbx ./wbx RUN adduser -D nonroot USER nonroot:nonroot # > "logs/$(date +'%Y%m%d_%H%M').log" 2>&1 ENTRYPOINT ["/wbx"]