Skip to content

Commit

Permalink
chore(worker): change context of docker build to root directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rot1024 committed Dec 5, 2024
1 parent 7fd205a commit 70d6834
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Build and push docker image
uses: docker/build-push-action@v6
with:
context: ./worker
file: ./worker/Dockerfile
platforms: ${{ steps.options.outputs.platforms }}
push: true
build-args: VERSION=${{ steps.options.outputs.version }}
Expand Down
12 changes: 6 additions & 6 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ ARG VERSION

RUN apk add --update --no-cache git ca-certificates build-base

COPY go.mod go.sum main.go /app/
COPY go.work go.work.sum server/go.mod server/go.sum server/main.go worker/go.mod worker/go.sum worker/main.go /app/
WORKDIR /app
RUN go mod download

COPY cmd/ /app/cmd/
COPY internal/ /app/internal/
COPY pkg/ /app/pkg/
COPY worker/cmd/ /app/worker/cmd/
COPY worker/internal/ /app/worker/internal/
COPY worker/pkg/ /app/worker/pkg/

RUN CGO_ENABLED=0 go build -tags "${TAG}" "-ldflags=-X main.version=${VERSION} -s -w -buildid=" -trimpath ./cmd/reearth-cms-worker
RUN CGO_ENABLED=0 go build -tags "${TAG}" "-ldflags=-X main.version=${VERSION} -s -w -buildid=" -trimpath ./worker/cmd/reearth-cms-worker

FROM scratch

COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=build /app/reearth-cms-worker /app/reearth-cms-worker
COPY --from=build /app/worker/reearth-cms-worker /app/reearth-cms-worker

WORKDIR /app

Expand Down

0 comments on commit 70d6834

Please sign in to comment.