From bef6b71f9030be0ac123139848d7c83934945a0e Mon Sep 17 00:00:00 2001 From: zhuojie Date: Fri, 24 Jul 2020 16:35:10 -0700 Subject: [PATCH] Update dockerfile --- Dockerfile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 73ed005..6b19f2b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ ARG UTASK_IMAGE=zhouzhuojie/utask:beta-with-middleware +FROM fufuhu/sql-migrate AS sql-migrate FROM ${UTASK_IMAGE} AS builder WORKDIR /go/src/github.com/ovh/utask COPY init init @@ -15,13 +16,19 @@ RUN make -FROM ${UTASK_IMAGE} -COPY --from=builder /go/src/github.com/ovh/utask/plugins /app/plugins -COPY --from=builder /go/src/github.com/ovh/utask/init /app/init -COPY --from=builder /go/src/github.com/ovh/utask/utask /app/utask -COPY --from=builder /go/src/github.com/ovh/utask/sql /app/sql -RUN go get -v github.com/rubenv/sql-migrate/... -COPY ./templates /app/templates -COPY ./dbconfig.yml /app/dbconfig.yml +FROM frolvlad/alpine-glibc:alpine-3.10 +RUN apk add --no-cache curl bash +ADD https://raw.githubusercontent.com/vishnubob/wait-for-it/master/wait-for-it.sh /wait-for-it.sh +RUN chmod +x /wait-for-it.sh +COPY --from=sql-migrate /bin/sql-migrate /usr/local/bin/sql-migrate +COPY --from=builder /go/src/github.com/ovh/utask/plugins /app/plugins +COPY --from=builder /go/src/github.com/ovh/utask/init /app/init +COPY --from=builder /go/src/github.com/ovh/utask/utask /app/utask +COPY --from=builder /go/src/github.com/ovh/utask/sql /app/sql +COPY --from=builder /app/static /app/static +COPY ./templates /app/templates +COPY ./dbconfig.yml /app/dbconfig.yml RUN chmod +x /app/utask +EXPOSE 8081 WORKDIR /app +CMD ["/app/utask"]