diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..2d95ce9f4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +*/templates +*/types +*/docs +*/db \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..d954d413d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM golang:1.10-alpine AS builder + +WORKDIR /go/src/github.com/crusttech/crust + +ENV CGO_ENABLED=0 + +COPY . . + +RUN mkdir /build; \ + find cmd -type d -mindepth 1 -maxdepth 1 | while read CMDPATH; do \ + go build -o /build/$(basename ${CMDPATH}) ${CMDPATH}/*.go; \ + done; + +FROM alpine:3.7 + +ENV PATH="/crust:{$PATH}" +WORKDIR /crust + +# @todo copy crm/types, migrations + +COPY --from=builder ./build/* /crust/ + +CMD ["/bin/echo", "Run of the crust commands: sam, crm"] \ No newline at end of file