Fix Dockerfile and move deployment stuff

Signed-off-by: Martyn Ranyard <m@rtyn.berlin>
This commit is contained in:
Martyn 2020-02-13 16:48:32 +01:00
parent 3f358aa1fa
commit e4b1cdd869
3 changed files with 4 additions and 3 deletions

View File

@ -1,12 +1,13 @@
FROM golang@sha256:cee6f4b901543e8e3f20da3a4f7caac6ea643fd5a46201c3c2387183a332d989 AS builder FROM golang@sha256:cee6f4b901543e8e3f20da3a4f7caac6ea643fd5a46201c3c2387183a332d989 AS builder
RUN apk update && apk add --no-cache git make ca-certificates && update-ca-certificates RUN apk update && apk add --no-cache git make ca-certificates && update-ca-certificates
COPY main.go /go/src/github.com/iMartyn/karaokards/ COPY main.go /go/src/git.martyn.berlin/martyn/karaokards/
RUN cd /go/src/github.com/iMartyn/karaokards/; go get; CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o karaokards . COPY internal/ /go/src/git.martyn.berlin/martyn/karaokards/internal/
RUN cd /go/src/git.martyn.berlin/martyn/karaokards/; go get; CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o karaokards .
#RUN ls /go/src/github.com/karaokards/ -l #RUN ls /go/src/github.com/karaokards/ -l
FROM scratch FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/src/github.com/iMartyn/karaokards/karaokards /app/ COPY --from=builder /go/src/git.martyn.berlin/martyn/karaokards /app/
COPY strings.json /app/strings.json COPY strings.json /app/strings.json
CMD ["/app/karaokards"] CMD ["/app/karaokards"]