diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index e60aacf..a8c4cd9 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -34,7 +34,7 @@ jobs: - name: Build Docker image run: | - docker build ./backend --tag ghcr.io/imterah/hermes:$GITHUB_REF_NAME + docker build . --tag ghcr.io/imterah/hermes:$GITHUB_REF_NAME - name: Upload Docker image run: | diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..81710a7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:latest AS build +WORKDIR /build +COPY . /build +RUN cd backend; bash build.sh +FROM busybox:stable-glibc AS run +WORKDIR /app +COPY --from=build /build/backend/backends.prod.json /app/backends.json +COPY --from=build /build/backend/api/api /app/hermes +COPY --from=build /build/backend/sshbackend/sshbackend /app/sshbackend +ENTRYPOINT ["/app/hermes", "--backends-path", "/app/backends.json"] diff --git a/backend/Dockerfile b/backend/Dockerfile deleted file mode 100644 index 09859b5..0000000 --- a/backend/Dockerfile +++ /dev/null @@ -1,10 +0,0 @@ -FROM golang:latest AS build -WORKDIR /build -COPY . /build -RUN bash build.sh -FROM busybox:stable-glibc AS run -WORKDIR /app -COPY --from=build /build/backends.prod.json /app/backends.json -COPY --from=build /build/api/api /app/hermes -COPY --from=build /build/sshbackend/sshbackend /app/sshbackend -ENTRYPOINT ["/app/hermes", "--backends-path", "/app/backends.json"]