From ef3bb1c70f9f0c4bccfbe498f0427d942ef4e6ff Mon Sep 17 00:00:00 2001 From: Imanuel Ulbricht Date: Wed, 15 Jun 2022 00:56:56 +0200 Subject: [PATCH] Fixed issue with workdir in dockerfile --- Dockerfile | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 40ef432..b131662 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,27 +1,20 @@ -FROM quay.imanuel.dev/dockerhub/library---dart:sdk AS build +FROM quay.imanuel.dev/dockerhub/library---golang:1.18-alpine AS build # Resolve app dependencies. WORKDIR /app -COPY pubspec.* ./ -RUN dart pub get +COPY . . +RUN apk add git -# Copy app source code and AOT compile it. -COPY server . -# Ensure packages are still up-to-date if anything has changed -RUN dart pub get --offline -RUN dart compile exe bin/server.dart -o bin/server -RUN dart compile exe bin/console.dart -o bin/console +RUN go build -o /app/jinya-backup jinya-backup FROM quay.imanuel.dev/dockerhub/library---node:latest AS build-frontend -COPY server/frontend /app/frontend -RUN cd /app/frontend && npm install +COPY web/ /app/web +RUN cd /app/web && npm install FROM quay.imanuel.dev/dockerhub/library---alpine:latest -COPY --from=build /runtime/ / -COPY --from=build /app/bin/server /bin/ -COPY --from=build /app/bin/console /bin/ -COPY --from=build /app/docker/entrypoint.sh / -COPY --from=build-frontend /app/frontend /frontend +WORKDIR /app +COPY --from=build /app/jinya-backup /app/jinya-backup +COPY --from=build-frontend /app/web /app/web # Start server. -ENTRYPOINT "/entrypoint.sh" \ No newline at end of file +ENTRYPOINT ["/app/jinya-backup", "serve"] \ No newline at end of file