Add Docker support with CI workflow and runtime configuration
Build and Push Docker Image / build-and-push (push) Failing after 1m52s

- Added `Dockerfile` to build a Docker image for the JavadocViewerService.
- Implemented a Gitea-based CI workflow (`deploy-image.yml`) to build and push the Docker image.
- Updated `settings.local.json` to expand permissions for the service.
- Included `-DskipTests` to Maven arguments in `JavadocService.java`.
This commit is contained in:
2026-06-29 18:04:09 +02:00
parent dea9d0b9a0
commit 4dbca41a24
4 changed files with 90 additions and 2 deletions
+49
View File
@@ -0,0 +1,49 @@
name: Build and Push Docker Image
on:
push:
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
uses: docker/login-action@v3
with:
registry: ${{ gitea.server_url && fromJSON('{}') || '' }}${{ vars.GITEA_HOST || 'git.mein-gateway.de' }}
username: ${{ gitea.actor }}
password: ${{ secrets.GITEA_TOKEN }}
- name: Compute image name and tag
id: meta
run: |
OWNER=$(echo "${{ gitea.repository_owner }}" | tr '[:upper:]' '[:lower:]')
IMAGE_NAME=$(echo "javadocviewerservice" | tr '[:upper:]' '[:lower:]')
REGISTRY="${{ vars.GITEA_HOST || 'git.mein-gateway.de' }}"
FULL_IMAGE="${REGISTRY}/${OWNER}/${IMAGE_NAME}"
REF="${{ gitea.ref_name }}"
if [ "${REF}" = "main" ]; then
TAG="latest"
else
TAG=$(echo "${REF}" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9._-]/-/g')
fi
echo "image=${FULL_IMAGE}" >> "$GITHUB_OUTPUT"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Image: ${FULL_IMAGE}:${TAG}"
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ steps.meta.outputs.image }}:${{ steps.meta.outputs.tag }}