diff --git a/aggregator/Dockerfile b/aggregator/Dockerfile index 418c392e3..b82e921c7 100644 --- a/aggregator/Dockerfile +++ b/aggregator/Dockerfile @@ -11,12 +11,12 @@ RUN --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ COPY . . RUN --mount=type=cache,target=/root/.cache/go-build,id=ccv-go-build \ --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ - cd aggregator && CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/aggregator cmd/main.go + cd aggregator/cmd && CGO_ENABLED=0 go build -out aggregator -ldflags='-s -w' . FROM alpine:latest WORKDIR /app RUN apk --no-cache add ca-certificates -COPY --from=builder /bin/aggregator bin/ +COPY --from=builder /app/aggregator/cmd/aggregator bin/aggregator COPY --from=builder /app/aggregator/migrations /migrations RUN ln -s /migrations /app/migrations || true CMD ["/app/bin/aggregator"] diff --git a/build/devenv/Justfile b/build/devenv/Justfile index f66354e2c..085dbcf10 100644 --- a/build/devenv/Justfile +++ b/build/devenv/Justfile @@ -64,11 +64,11 @@ build-docker-dev-ci: # Build all the services for production build-docker-rc: @just fakes/build - @just ../../services/pricer/build-rc - @just ../../services/verifier/build-rc - @just ../../services/executor/build-rc - @just ../../services/indexer/build-rc - @just ../../services/aggregator/build-rc + @just ../../pricer/build-rc + @just ../../verifier/build-rc + @just ../../executor/build-rc + @just ../../indexer/build-rc + @just ../../aggregator/build-rc # Rebuild CLI cli: diff --git a/executor/Dockerfile b/executor/Dockerfile index ae563cbdf..2a97cdb48 100644 --- a/executor/Dockerfile +++ b/executor/Dockerfile @@ -12,7 +12,7 @@ COPY . . WORKDIR /cmd/executor RUN --mount=type=cache,target=/root/.cache/go-build,id=ccv-go-build \ --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ - CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/executor main.go + CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/executor . FROM alpine:latest RUN apk --no-cache add ca-certificates diff --git a/indexer/Dockerfile b/indexer/Dockerfile index f9c14a358..5572209f0 100644 --- a/indexer/Dockerfile +++ b/indexer/Dockerfile @@ -11,10 +11,10 @@ RUN --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ COPY . . RUN --mount=type=cache,target=/root/.cache/go-build,id=ccv-go-build \ --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ - cd indexer && CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/indexer cmd/main.go + cd indexer/cmd && CGO_ENABLED=0 go build -out indexer -ldflags='-s -w' . FROM alpine:latest RUN apk --no-cache add ca-certificates -COPY --from=builder /bin/indexer /bin/ +COPY --from=builder /app/indexer/cmd/indexer /bin/indexer COPY --from=builder /app/indexer/migrations ./migrations CMD ["/bin/indexer"] diff --git a/pricer/Dockerfile b/pricer/Dockerfile index 8173d9e14..9839b89e8 100644 --- a/pricer/Dockerfile +++ b/pricer/Dockerfile @@ -12,7 +12,7 @@ COPY . . WORKDIR /pricer/cmd RUN --mount=type=cache,target=/root/.cache/go-build,id=ccv-go-build \ --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ - CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-s -w' -o /bin/pricer main.go + CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -ldflags='-s -w' -o /bin/pricer . # Release on alpine to keep size small FROM alpine:latest diff --git a/verifier/Dockerfile b/verifier/Dockerfile index 1fcf4c5e2..63ea5f16d 100644 --- a/verifier/Dockerfile +++ b/verifier/Dockerfile @@ -15,7 +15,7 @@ WORKDIR /cmd/verifier/${VERIFIER_TYPE} RUN --mount=type=cache,target=/root/.cache/go-build,id=ccv-go-build \ --mount=type=cache,target=/go/pkg/mod,id=ccv-go-mod \ - CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/verifier main.go + CGO_ENABLED=0 go build -ldflags='-s -w' -o /bin/verifier . FROM alpine:latest RUN apk --no-cache add ca-certificates