Add dockerized version

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-12-01 03:55:41 +01:00
parent 29b17f4b7d
commit deb8c38857
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

36
Dockerfile Normal file
View file

@ -0,0 +1,36 @@
FROM golang:alpine as builder
COPY . /go/src/github.com/Luzifer/go-latestver
WORKDIR /go/src/github.com/Luzifer/go-latestver
RUN set -ex \
&& apk add --update \
build-base \
git \
make \
nodejs \
npm \
sqlite-dev \
&& make build \
&& go install \
-ldflags "-X main.version=$(git describe --tags --always || echo dev)" \
-mod=readonly
FROM alpine:latest
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
RUN set -ex \
&& apk --no-cache add \
ca-certificates \
sqlite
COPY --from=builder /go/bin/go-latestver /usr/local/bin/go-latestver
EXPOSE 3000
VOLUME ["/data"]
ENTRYPOINT ["/usr/local/bin/go-latestver"]
CMD ["--"]
# vim: set ft=Dockerfile: