1
0
Fork 0
mirror of https://github.com/Luzifer/staticmap.git synced 2024-12-05 14:14:02 +00:00
staticmap/Dockerfile
Knut Ahlers 963c048987
Add go modules support
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2021-02-19 19:26:07 +01:00

31 lines
649 B
Docker

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