Compare commits

...

2 Commits

Author SHA1 Message Date
siujamo a2469c7573 docs: update application configuration example
Build and Deploy / build-and-release (release) Failing after 5m14s
2026-06-08 13:32:16 +08:00
siujamo 62fcce3005 feat: add OCI labels and README push for Docker Hub
Add OCI standard labels to Dockerfile.ci and push README.md to
Docker Hub image page via docker-pushrm in CI workflow.
2026-06-05 10:20:15 +08:00
4 changed files with 37 additions and 44 deletions
+14 -1
View File
@@ -65,8 +65,21 @@ jobs:
with: with:
context: . context: .
file: Dockerfile.ci file: Dockerfile.ci
build-args: JAR_FILE=${{ steps.jar.outputs.file }} build-args: |
JAR_FILE=${{ steps.jar.outputs.file }}
IMAGE_VERSION=${{ gitea.event.release.tag_name }}
IMAGE_VENDOR=${{ vars.VENDOR }}
BUILD_DATE=${{ gitea.event.release.published_at }}
push: true push: true
tags: | tags: |
${{ steps.meta.outputs.tag_version }} ${{ steps.meta.outputs.tag_version }}
${{ steps.meta.outputs.tag_latest }} ${{ steps.meta.outputs.tag_latest }}
- name: Push README to Docker Hub
run: >
docker run --rm
-v "$(pwd)/README.md:/workspace/README.md:ro"
-e DOCKER_USER="${{ vars.DOCKER_HUB_USERNAME }}"
-e DOCKER_PASS="${{ secrets.DOCKER_HUB_TOKEN }}"
chko/docker-pushrm:latest
"${{ vars.DOCKER_HUB_USERNAME }}/${{ env.APP_NAME }}"
-34
View File
@@ -1,34 +0,0 @@
variables:
GRADLE_OPTS: -Dorg.gradle.daemon=false
DOCKER_HOST: unix:///var/run/docker.sock
stages:
- release
release:
stage: release
image: amazoncorretto:21-alpine
cache:
key: gradle
paths:
- .gradle/wrapper
- .gradle/caches
before_script:
- chmod +x gradlew
- apk add --no-cache docker-cli
script:
- ./gradlew bootJar -x test -PartefactVersion="$CI_COMMIT_TAG"
- JAR_FILE=$(find build/libs -name '*.jar' | head -1)
- echo "Building Docker image for tag $CI_COMMIT_TAG with JAR $JAR_FILE"
- docker build
-f Dockerfile.ci
--build-arg JAR_FILE="$JAR_FILE"
-t "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
.
- docker tag "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG" "$CI_REGISTRY_IMAGE:latest"
- echo "Pushing image $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker login "$CI_REGISTRY" -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- docker push "$CI_REGISTRY_IMAGE:$CI_COMMIT_TAG"
- docker push "$CI_REGISTRY_IMAGE:latest"
rules:
- if: $CI_COMMIT_TAG
+12
View File
@@ -2,6 +2,18 @@ FROM amazoncorretto:21-alpine
WORKDIR /app WORKDIR /app
ARG JAR_FILE ARG JAR_FILE
ARG IMAGE_VERSION=dev
ARG IMAGE_VENDOR=OnixByte
ARG BUILD_DATE
COPY ${JAR_FILE} app.jar COPY ${JAR_FILE} app.jar
LABEL org.opencontainers.image.title="delta-force-guide-server" \
org.opencontainers.image.description="REST API backend for managing Delta Force game firearm builds and modifications" \
org.opencontainers.image.version="${IMAGE_VERSION}" \
org.opencontainers.image.vendor="${IMAGE_VENDOR}" \
org.opencontainers.image.source="https://git.onixbyte.com/onixbyte/delta-force-guide-server" \
org.opencontainers.image.licenses="MIT" \
org.opencontainers.image.created="${BUILD_DATE}"
ENTRYPOINT ["java", "-jar", "app.jar"] ENTRYPOINT ["java", "-jar", "app.jar"]
+11 -9
View File
@@ -9,15 +9,19 @@ spring:
host: localhost host: localhost
port: 6379 port: 6379
database: 0 database: 0
# password: 6hLFVqfGPviTYukn # Uncomment if password is necessary # password: qwerty # Uncomment if password is necessary
logging: logging:
pattern: pattern:
# dateformat: dd MMM yyyy HH:mm:ss.SSS # Modify this for custom date format. # dateformat: dd MMM yyyy HH:mm:ss.SSS # Modify this for custom date format.
app: app:
common: cookie:
version: 1.3.0.8-dev # Application version, you can change to any version you like, used for communication with frontend. http-only: true
secure: false
same-site: none
path: '/'
max-age: P1D
cors: cors:
allowed-origins: # Cross-origin allowed origins allowed-origins: # Cross-origin allowed origins
- "http://localhost:5173" # Dev server for vite. - "http://localhost:5173" # Dev server for vite.
@@ -41,12 +45,10 @@ app:
issuer: dfguide.local # Issuer host issuer: dfguide.local # Issuer host
secret: qwertyuiopasdfghjklzxcvbnm123456 # JWT singing secret, a 32-byte long or longer string is recommended secret: qwertyuiopasdfghjklzxcvbnm123456 # JWT singing secret, a 32-byte long or longer string is recommended
valid-time: PT2H # JWT valid duration valid-time: PT2H # JWT valid duration
cookie: # Cookie settings. webhook:
http-only: true github:
secure: false secret: 123456
same-site: lax allowed-users: [ octotcat, onixbyte ]
path: '/'
max-age: PT2H
springdoc: springdoc:
api-docs: api-docs: