diff --git a/Dockerfile b/Dockerfile index 9eba9701..5baffadb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,13 @@ -FROM node:lts-bookworm-slim AS base +FROM node:lts-trixie-slim AS base # Install dependencies only when needed FROM base AS deps WORKDIR /app +RUN apt-get update && apt-get install -y --no-install-recommends \ + python3 make g++ \ + && rm -rf /var/lib/apt/lists/* + # Install dependencies based on the preferred package manager COPY bookie/package.json bookie/yarn.lock* bookie/package-lock.json* bookie/pnpm-lock.yaml* ./ RUN \ @@ -25,9 +29,13 @@ RUN \ else echo "Lockfile not found." && exit 1; \ fi -FROM python:3.14 AS runner +FROM python:3.14-slim AS runner LABEL maintainer="Amritanshu " +RUN apt update \ + && apt install -y --no-install-recommends curl \ + && rm -rf /var/lib/apt/lists/* + # Install uv # Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ diff --git a/Makefile b/Makefile index 84f8724d..7f30cb27 100644 --- a/Makefile +++ b/Makefile @@ -4,5 +4,24 @@ build-production: ## Build the production docker image. --platform linux/amd64,linux/arm64/v8 \ --tag registry.tanshu.com/barker:latest \ $(if $(TAG),--tag registry.tanshu.com/barker:$(TAG)) \ + --pull \ --push \ git@git.tanshu.com:tanshu/barker.git + +.PHONY: build-check +build-check: ## Multi-arch build without push (compile check) + @docker buildx build \ + --platform linux/amd64,linux/arm64/v8 \ + --tag barker:test \ + --pull \ + --progress=plain \ + git@git.tanshu.com:tanshu/barker.git + +.PHONY: build-check-local +build-check-local: ## Multi-arch build without push (compile check) + @git archive --format=tar HEAD | docker buildx build \ + --platform linux/amd64,linux/arm64/v8 \ + --tag barker:test \ + --pull \ + --progress=plain \ + -