ci: lean Dockerfile (drop build-essential), split+timeout build steps, buildkit
build-image / build (push) Successful in 20s
build-image / build (push) Successful in 20s
This commit is contained in:
@@ -12,20 +12,32 @@ permissions:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 20
|
||||
env:
|
||||
IMAGE: git.farh.net/farhoodlabs/intervalsicu-mcp
|
||||
DOCKER_BUILDKIT: "1"
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build and push image
|
||||
- name: Environment
|
||||
run: |
|
||||
docker version || true
|
||||
df -h / || true
|
||||
|
||||
- name: Login to registry
|
||||
run: |
|
||||
set -eu
|
||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.farh.net -u cpfarhood --password-stdin
|
||||
docker build \
|
||||
|
||||
- name: Build image
|
||||
run: |
|
||||
docker build --progress=plain \
|
||||
-t "${IMAGE}:latest" \
|
||||
-t "${IMAGE}:${GITHUB_SHA}" \
|
||||
.
|
||||
|
||||
- name: Push image
|
||||
run: |
|
||||
docker push "${IMAGE}:latest"
|
||||
docker push "${IMAGE}:${GITHUB_SHA}"
|
||||
echo "pushed ${IMAGE}:latest and ${IMAGE}:${GITHUB_SHA}"
|
||||
|
||||
+3
-12
@@ -1,25 +1,16 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install build dependencies and Python build backend
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python build tool
|
||||
RUN pip install --no-cache-dir hatchling
|
||||
|
||||
# Copy project files
|
||||
COPY pyproject.toml pyproject.toml
|
||||
COPY src src
|
||||
COPY README.md README.md
|
||||
COPY .env.example .env.example
|
||||
|
||||
# Install the package and runtime dependencies
|
||||
# Install the package and runtime dependencies. All dependencies ship as
|
||||
# manylinux wheels (pydantic-core, cryptography, etc.), so no build toolchain
|
||||
# is required — keeping the image small and the build fast.
|
||||
RUN pip install --no-cache-dir .
|
||||
|
||||
# Run the MCP server. Transport is selected via MCP_TRANSPORT (default stdio);
|
||||
|
||||
Reference in New Issue
Block a user