3
0

Add Dockerfile, .dockerignore

Took 1 hour 25 minutes
This commit is contained in:
Denis Arh 2018-07-06 12:19:57 +02:00
parent ab943146d3
commit f9e91bd5a9
2 changed files with 27 additions and 0 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
*/templates
*/types
*/docs
*/db

23
Dockerfile Normal file
View File

@ -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"]