diff --git a/backend/.dockerignore b/backend/.dockerignore index 739d5f19..ed54ce6f 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -39,3 +39,10 @@ coverage.txt # Temporary files *.tmp *~ +**/tmp + +# Git directories +.git/ + +# Node modules +**/node_modules diff --git a/backend/Dockerfile b/backend/Dockerfile index 7569bca1..877f70a5 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -2,13 +2,15 @@ FROM golang:1.22.9 AS build WORKDIR /go/src/app -COPY . . +# Copy all required modules from parent directory +COPY .. . ENV GO111MODULE on -RUN go install -v ./... +# Build from the backend directory which contains the main.go +RUN cd backend && go install -v ./... FROM alpine:3.14 -# copy files +# Copy the built binary COPY --from=build /go/bin/crawlab /go/bin/crawlab