2022-07-26 11:30:23 -04:00
|
|
|
FROM golang:1.18-alpine AS build_base
|
|
|
|
RUN apk add --no-cache git gcc ca-certificates libc-dev
|
|
|
|
WORKDIR /build
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
COPY ./ ./
|
|
|
|
RUN go build -ldflags "-w -s" -trimpath -o speedtest .
|
2020-06-30 22:03:12 -04:00
|
|
|
|
2022-07-26 11:30:23 -04:00
|
|
|
FROM alpine:3.16
|
|
|
|
RUN apk add --no-cache ca-certificates
|
2020-06-30 22:03:12 -04:00
|
|
|
WORKDIR /app
|
2022-07-26 11:30:23 -04:00
|
|
|
COPY --from=build_base /build/speedtest ./
|
|
|
|
COPY settings.toml ./
|
2020-06-30 22:03:12 -04:00
|
|
|
|
2022-07-26 11:30:23 -04:00
|
|
|
USER nobody
|
2020-06-30 22:03:12 -04:00
|
|
|
EXPOSE 8989
|
|
|
|
|
2020-08-10 23:48:13 -04:00
|
|
|
CMD ["./speedtest"]
|