diff --git a/.github/workflows/docker-crawlab.yml b/.github/workflows/docker-crawlab.yml index c74ae702..28bb17a9 100644 --- a/.github/workflows/docker-crawlab.yml +++ b/.github/workflows/docker-crawlab.yml @@ -199,7 +199,8 @@ jobs: - name: Build and push image uses: docker/build-push-action@v5 with: - context: ${{ env.IMAGE_PATH_CRAWLAB_BACKEND }} + context: . + file: ${{ env.IMAGE_PATH_CRAWLAB_BACKEND }}/Dockerfile push: true tags: ${{ env.IMAGE_NAME_CRAWLAB_BACKEND }}:${{ needs.setup.outputs.version }} - name: Set output diff --git a/backend/Dockerfile b/backend/Dockerfile index 877f70a5..6fee1322 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,9 +1,18 @@ FROM golang:1.22.9 AS build +# Context path is the root of the repository + WORKDIR /go/src/app -# Copy all required modules from parent directory -COPY .. . +# Copy the current directory (backend) first +COPY ./backend ./backend/ + +# Copy required modules from relative paths +COPY ./core ./core/ +COPY ./db ./db/ +COPY ./grpc ./grpc/ +COPY ./trace ./trace/ +COPY ./vcs ./vcs/ ENV GO111MODULE on