Files
crawlab/backend/Dockerfile
Marvin Zhang 3932b298bf chore: refine Docker build process and update context paths
- 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.
2024-12-20 12:17:15 +08:00

26 lines
522 B
Docker

FROM golang:1.22.9 AS build
# Context path is the root of the repository
WORKDIR /go/src/app
# 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
# Build from the backend directory which contains the main.go
RUN cd backend && go install -v ./...
FROM alpine:3.14
# Copy the built binary
COPY --from=build /go/bin/crawlab /go/bin/crawlab