2018-09-17 09:31:18 +00:00
|
|
|
FROM golang:alpine as builder
|
2017-03-05 17:26:04 +00:00
|
|
|
|
2018-09-17 09:31:18 +00:00
|
|
|
ADD . /go/src/github.com/Luzifer/tex-api
|
|
|
|
WORKDIR /go/src/github.com/Luzifer/tex-api
|
2017-03-05 17:26:04 +00:00
|
|
|
|
2017-03-05 22:19:43 +00:00
|
|
|
RUN set -ex \
|
2018-09-17 09:31:18 +00:00
|
|
|
&& apk add --update git \
|
|
|
|
&& go install -ldflags "-X main.version=$(git describe --tags || git rev-parse --short HEAD || echo dev)"
|
2017-03-05 22:19:43 +00:00
|
|
|
|
2018-09-17 09:31:18 +00:00
|
|
|
FROM alpine:latest
|
|
|
|
|
|
|
|
LABEL maintainer "Knut Ahlers <knut@ahlers.me>"
|
2017-03-05 17:26:04 +00:00
|
|
|
|
|
|
|
RUN set -ex \
|
2018-09-17 09:31:18 +00:00
|
|
|
&& apk --no-cache add \
|
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
texlive-full
|
2017-03-05 17:26:04 +00:00
|
|
|
|
2018-09-17 09:31:18 +00:00
|
|
|
COPY --from=builder /go/bin/tex-api /usr/local/bin/
|
|
|
|
COPY --from=builder /go/src/github.com/Luzifer/tex-api/tex-build.sh /usr/local/bin/
|
2017-03-05 17:26:04 +00:00
|
|
|
|
2018-09-17 09:31:18 +00:00
|
|
|
EXPOSE 3000
|
2017-03-05 22:19:43 +00:00
|
|
|
VOLUME ["/storage"]
|
2017-03-05 17:26:04 +00:00
|
|
|
|
2018-09-17 09:31:18 +00:00
|
|
|
ENTRYPOINT ["/usr/local/bin/tex-api"]
|
|
|
|
CMD ["--script", "/usr/local/bin/tex-build.sh"]
|
|
|
|
|
|
|
|
# vim: set ft=Dockerfile:
|