7d78e65d0c
Add semantic versioning to all services * working * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/semver * 1.24 mod * go upgrade * tool * Merge branch 'main' of bitbucket.org:aarete/query-orchestration into feature/semver
33 lines
621 B
Docker
33 lines
621 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
ARG GO_VERSION=1.24.0
|
|
|
|
FROM golang:${GO_VERSION} AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Install Git if not already present
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git=1:2.* && apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
# Copy the entire repository including .git directory
|
|
COPY . .
|
|
|
|
ARG TARGETARCH
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
|
RUN --mount=type=cache,target=/go/pkg/mod/ \
|
|
CGO_ENABLED=0 GOARCH=$TARGETARCH go build -o /bin ./cmd/...
|
|
|
|
FROM scratch AS final
|
|
|
|
ENV PWD=/app
|
|
|
|
WORKDIR ${PWD}
|
|
|
|
COPY database/migrations/ database/migrations/
|
|
|
|
COPY --from=build /bin/ .
|
|
|
|
EXPOSE 8080
|