chore: Update Docker configuration and documentation
Some checks failed
API Docs (Node.js Express) / test (20) (push) Failing after 1m49s
API Docs (Node.js Express) / build (push) Has been skipped
API Gateway (Java Spring Boot) / test (17) (push) Failing after 3m18s
Docker Build and Push / setup (push) Successful in 10s
API Gateway (Java Spring Boot) / test (21) (push) Successful in 1m56s
API Gateway (Java Spring Boot) / build (push) Has been skipped
Docker Build and Push / build-push-service-adapters (push) Failing after 29s
Docker Build and Push / build-push-api-gateway (push) Failing after 32s
Docker Build and Push / build-push-api-docs (push) Failing after 31s
Docker Build and Push / build-push-frontend (push) Failing after 28s
Docker Build and Push / test-compatibility (push) Has been skipped
Integration Tests / integration-tests (push) Failing after 2m47s
Integration Tests / performance-tests (push) Has been skipped

### Summary of Changes
- Enhanced `docker-compose` files to include BuildKit compatibility settings for improved caching during builds.
- Updated service definitions to use pre-built images from the specified Docker registry, ensuring consistency across environments.
- Added Docker registry configuration to the `.env` example file for clarity on deployment settings.
- Revised the `README.md` to include instructions for using pre-built images and local development setups, along with Docker compatibility troubleshooting steps.
- Introduced health checks in the `Dockerfile` for the API Docs service to ensure container readiness.

### Expected Results
- Improved build performance and deployment clarity, facilitating easier setup for new developers and enhancing overall project maintainability.
This commit is contained in:
GSRN
2025-09-18 00:28:21 +02:00
parent af33bc2d20
commit 7bb753e293
10 changed files with 361 additions and 28 deletions

View File

@@ -62,7 +62,7 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push API Gateway
- name: Build and push API Gateway (Legacy Builder)
uses: docker/build-push-action@v5
with:
context: ./services/api-gateway
@@ -72,6 +72,10 @@ jobs:
labels: ${{ needs.setup.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/api-gateway:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/api-gateway:cache,mode=max
# Use legacy builder for maximum compatibility
builder: default
build-args: |
BUILDKIT_INLINE_CACHE=0
# Service Adapters build and push
build-push-service-adapters:
@@ -92,7 +96,7 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Service Adapters
- name: Build and push Service Adapters (Legacy Builder)
uses: docker/build-push-action@v5
with:
context: ./services/service-adapters
@@ -102,6 +106,10 @@ jobs:
labels: ${{ needs.setup.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/service-adapters:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/service-adapters:cache,mode=max
# Use legacy builder for maximum compatibility
builder: default
build-args: |
BUILDKIT_INLINE_CACHE=0
# API Docs build and push
build-push-api-docs:
@@ -122,7 +130,7 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push API Docs
- name: Build and push API Docs (Legacy Builder)
uses: docker/build-push-action@v5
with:
context: ./services/api-docs
@@ -132,6 +140,10 @@ jobs:
labels: ${{ needs.setup.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/api-docs:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/api-docs:cache,mode=max
# Use legacy builder for maximum compatibility
builder: default
build-args: |
BUILDKIT_INLINE_CACHE=0
# Frontend build and push
build-push-frontend:
@@ -152,7 +164,7 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Frontend
- name: Build and push Frontend (Legacy Builder)
uses: docker/build-push-action@v5
with:
context: ./frontend
@@ -162,3 +174,61 @@ jobs:
labels: ${{ needs.setup.outputs.labels }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/frontend:cache
cache-to: type=registry,ref=${{ env.REGISTRY }}/${{ env.REPO_OWNER }}/frontend:cache,mode=max
# Use legacy builder for maximum compatibility
builder: default
build-args: |
BUILDKIT_INLINE_CACHE=0
# Compatibility test job
test-compatibility:
runs-on: self-hosted
needs: [build-push-api-gateway, build-push-service-adapters, build-push-api-docs, build-push-frontend]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Test API Docs compatibility
run: |
echo "Testing API Docs image compatibility..."
# Pull the latest image
docker pull ${{ env.REGISTRY }}/admin/api-docs:${{ needs.setup.outputs.version }}
# Test running the container
docker run --rm -d --name test-api-docs \
-p 8083:8083 \
${{ env.REGISTRY }}/admin/api-docs:${{ needs.setup.outputs.version }}
# Wait for container to start
sleep 10
# Check if container is running
if docker ps | grep -q test-api-docs; then
echo "✓ API Docs container started successfully"
else
echo "✗ API Docs container failed to start"
docker logs test-api-docs
exit 1
fi
# Clean up
docker stop test-api-docs || true
- name: Test docker-compose compatibility
run: |
echo "Testing docker-compose configuration..."
# Validate docker-compose.yml
docker-compose config > /dev/null
if [ $? -eq 0 ]; then
echo "✓ docker-compose.yml is valid"
else
echo "✗ docker-compose.yml has syntax errors"
exit 1
fi
- name: Compatibility test completed
run: |
echo "✓ All compatibility tests passed"
echo "Images are ready for deployment with maximum Docker version compatibility"