2024-11-28 14:00:22 +00:00
|
|
|
FROM golang:1.23-alpine AS builder
|
2024-10-11 18:43:08 +00:00
|
|
|
RUN <<EOF
|
|
|
|
apk -U add git
|
|
|
|
mkdir -p /opt
|
|
|
|
cd /opt
|
2024-11-29 13:44:23 +00:00
|
|
|
git clone https://github.com/ryanolee/go-pot
|
|
|
|
cd go-pot
|
|
|
|
git checkout fbb3e66e454e5f6092b4294a52e2cfa44e5b7259
|
2024-10-11 18:43:08 +00:00
|
|
|
EOF
|
|
|
|
WORKDIR /opt/go-pot
|
|
|
|
#
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /opt/go-pot/go-pot
|
|
|
|
#
|
2024-11-28 14:55:27 +00:00
|
|
|
FROM scratch
|
2024-10-11 18:43:08 +00:00
|
|
|
#
|
|
|
|
COPY --from=builder /opt/go-pot/go-pot /opt/go-pot/go-pot
|
2024-11-29 13:44:23 +00:00
|
|
|
COPY dist/config.yml /opt/go-pot/config.yml
|
2024-10-11 18:43:08 +00:00
|
|
|
#
|
2024-10-18 19:59:29 +00:00
|
|
|
STOPSIGNAL SIGINT
|
2024-11-28 14:00:22 +00:00
|
|
|
USER 2000:2000
|
2024-10-11 18:43:08 +00:00
|
|
|
WORKDIR /opt/go-pot
|
|
|
|
CMD ["start", "--host", "0.0.0.0", "--config-file", "config.yml"]
|
|
|
|
ENTRYPOINT ["./go-pot"]
|