Improved Dockerfile to properly build and ship a runtime image
This commit is contained in:
parent
6fd5235ec9
commit
276d8f7849
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
build
|
build
|
||||||
release
|
release
|
||||||
|
dispatch
|
||||||
client/dist
|
client/dist
|
||||||
client/node_modules
|
client/node_modules
|
||||||
client/yarn-error.log
|
client/yarn-error.log
|
||||||
|
21
Dockerfile
21
Dockerfile
@ -1,7 +1,22 @@
|
|||||||
FROM scratch
|
# Build
|
||||||
|
FROM golang:alpine AS build
|
||||||
|
|
||||||
ADD build/dispatch /
|
RUN apk add --update git make build-base && \
|
||||||
ADD ca-certificates.crt /etc/ssl/certs/
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
WORKDIR /go/src/github.com/khlieng/dispatch
|
||||||
|
COPY . /go/src/github.com/khlieng/dispatch
|
||||||
|
RUN go build .
|
||||||
|
|
||||||
|
# Runtime
|
||||||
|
FROM alpine
|
||||||
|
|
||||||
|
RUN apk add --update ca-certificates && \
|
||||||
|
rm -rf /var/cache/apk/*
|
||||||
|
|
||||||
|
COPY --from=build /go/src/github.com/khlieng/dispatch/dispatch /dispatch
|
||||||
|
|
||||||
|
EXPOSE 80/tcp
|
||||||
|
|
||||||
VOLUME ["/data"]
|
VOLUME ["/data"]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user