feat(ci): add Docker build pipeline with version management
- Add multi-stage Dockerfile with pinned tool versions (Node 24.10.0, Go 1.25.1, Hugo 0.151.0) - Create .env.versions as single source of truth for all tool versions - Add GitHub Actions CI workflow for automated OCI image builds - Multi-arch support (amd64, arm64) - Automatic version loading from .env.versions - Docker registry push with metadata tags - Add Taskfile tasks for local OCI image building and testing - task build:oci-image - Build with version-pinned dependencies - task test:oci-image - Build and test container locally - Pin devbox.json to specific versions matching .env.versions - Add comprehensive documentation (DOCKER.md, VERSIONS.md) - Add helper script (scripts/get-versions.sh) for version extraction This enables consistent development and production environments with identical tool versions across local devbox, Docker builds, and CI/CD.
This commit is contained in:
parent
8e0aea2893
commit
4294524e81
9 changed files with 406 additions and 3 deletions
34
Taskfile.yml
34
Taskfile.yml
|
|
@ -86,3 +86,37 @@ tasks:
|
|||
desc: Run CI pipeline locally
|
||||
deps:
|
||||
- test
|
||||
|
||||
build:oci-image:
|
||||
desc: Build OCI/Docker image with versions from .env.versions
|
||||
cmds:
|
||||
- |
|
||||
set -a
|
||||
source .env.versions
|
||||
set +a
|
||||
echo "Building OCI image with versions:"
|
||||
echo " NODE_VERSION=${NODE_VERSION}"
|
||||
echo " GO_VERSION=${GO_VERSION}"
|
||||
echo " HUGO_VERSION=${HUGO_VERSION}"
|
||||
docker build --network=host \
|
||||
--build-arg NODE_VERSION=${NODE_VERSION} \
|
||||
--build-arg GO_VERSION=${GO_VERSION} \
|
||||
--build-arg HUGO_VERSION=${HUGO_VERSION} \
|
||||
-t ipceicis-developerframework:latest \
|
||||
-t ipceicis-developerframework:$(git rev-parse --short HEAD) \
|
||||
.
|
||||
|
||||
test:oci-image:
|
||||
desc: Test the built OCI image
|
||||
deps:
|
||||
- build:oci-image
|
||||
cmds:
|
||||
- |
|
||||
echo "Starting container on port 8080..."
|
||||
docker run -d -p 8080:80 --name hugo-test ipceicis-developerframework:latest
|
||||
sleep 2
|
||||
echo "Testing endpoint..."
|
||||
curl -f http://localhost:8080 > /dev/null && echo "✓ Container is running and responding" || echo "✗ Container test failed"
|
||||
echo "Cleaning up..."
|
||||
docker stop hugo-test
|
||||
docker rm hugo-test
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue