Skip to content

Conversation

obazoud
Copy link
Contributor

@obazoud obazoud commented Sep 6, 2025

…g for dependencies

@Copilot Copilot AI review requested due to automatic review settings September 6, 2025 12:18
Copy link

vercel bot commented Sep 6, 2025

@obazoud is attempting to deploy a commit to the Hookdeck Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes the Docker build process by leveraging Docker layer caching for Go dependencies. The change reorders Dockerfile commands to copy Go module files first and download dependencies before copying the entire source code.

  • Moves go.mod and go.sum copy operation before setting the working directory
  • Adds explicit go mod download step to cache dependencies in a separate layer

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

build/Dockerfile Outdated
Comment on lines 4 to 6
COPY go.mod go.sum ./
RUN go mod download
WORKDIR /app
Copy link
Preview

Copilot AI Sep 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The WORKDIR command should be set before copying files. Currently, go.mod and go.sum are copied to the root directory (/) instead of the intended /app directory, which will cause the go mod download command to fail.

Suggested change
COPY go.mod go.sum ./
RUN go mod download
WORKDIR /app
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

@alexluong alexluong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar question to the message in another thread, would love to understand your use case here. Since I personally don't use this Dockerfile, I just want to understand the motivation.

Potentially, I think it may make sense to simply remove this Dockerfil instead if you can continue your workflow without. With that in mind, happy to proceed and support this if it helps.

I just think this Dockerfile is nowhere close to production-ready, and I want to avoid spending time maintaining an unused Dockerfile if we can avoid it.

@obazoud
Copy link
Contributor Author

obazoud commented Sep 7, 2025

I’ve explained in the other thread how I use this Dockerfile in my local workflow to test my changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants