Add Dockerfile

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-06-14 14:20:31 +02:00
parent abe29c2290
commit 9f5882831a
Signed by: luzifer
GPG key ID: D91C3E91E4CAD6F5

31
Dockerfile Normal file
View file

@ -0,0 +1,31 @@
FROM golang:alpine as builder
COPY . /src/hold-this
WORKDIR /src/hold-this
RUN set -ex \
&& apk add --update git \
&& go install \
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly \
-modcacherw \
-trimpath
FROM alpine:latest
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
RUN set -ex \
&& apk --no-cache add \
ca-certificates
COPY --from=builder /go/bin/hold-this /usr/local/bin/hold-this
EXPOSE 3000
USER 1000:1000
ENTRYPOINT ["/usr/local/bin/hold-this"]
CMD ["--"]
# vim: set ft=Dockerfile: