diff --git a/Dockerfile b/Dockerfile index 81a8514..e4a3431 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,23 @@ FROM node as jsbuild -ADD s3browser-frontend /s3browser-frontend -WORKDIR /s3browser-frontend +ADD . /s3browser +WORKDIR /s3browser -RUN yarn install -RUN yarn run build +RUN make build-web FROM golang as gobuild -ADD s3browser-backend /s3browser-backend +ADD . /s3browser +WORKDIR /s3browser -WORKDIR /s3browser-backend +COPY --from=jsbuild /s3browser/s3browser-frontend/build /s3browser/s3browser-backend/internal/static -COPY --from=jsbuild /s3browser-frontend/build /s3browser-backend/internal/static - -RUN go build -o s3browser -tags prod ./cmd/s3Browser.go +RUN make build-backend FROM gcr.io/distroless/base-debian10 -COPY --from=gobuild /s3browser-backend/s3browser / +COPY --from=gobuild /s3browser/s3browser / -CMD [ "/s3browser" ] \ No newline at end of file +EXPOSE 3000 + +CMD [ "/s3browser" ] diff --git a/Makefile b/Makefile index b230be8..6bf8c39 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -BINARY_NAME=s3Browser +BINARY_NAME=s3browser all: build