Skip to content

Commit

Permalink
chore: refine Docker build process and update context paths
Browse files Browse the repository at this point in the history
- Updated GitHub Actions workflow to specify the Dockerfile location and set the build context to the root of the repository.
- Modified Dockerfile to copy backend and other required modules from their respective directories, improving the build process.
  • Loading branch information
tikazyq committed Dec 20, 2024
1 parent 83b81c8 commit 3932b29
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/docker-crawlab.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 11 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down

0 comments on commit 3932b29

Please sign in to comment.