Skip to content

Commit 3d8fe3a

Browse files
committed
Docker files for alarm server
1 parent c443eb0 commit 3d8fe3a

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Save-And-Restore Docker Image CI
2+
3+
on:
4+
push:
5+
branches: [ "CSSTUDIO-2989" ]
6+
paths: services/alarm-server/**
7+
tags:
8+
- '**'
9+
10+
env:
11+
REGISTRY: ghcr.io
12+
IMAGE_NAME: ${{ github.repository }}/service-alarm-server
13+
14+
jobs:
15+
build-and-push-image:
16+
permissions:
17+
contents: read
18+
packages: write
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up JDK 17
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: '17'
26+
distribution: 'temurin'
27+
cache: maven
28+
- name: Build with Maven
29+
run: mvn --batch-mode --update-snapshots package
30+
- name: Login to the registry
31+
uses: docker/login-action@v3
32+
with:
33+
registry: ${{ env.REGISTRY }}
34+
username: ${{ github.actor }}
35+
password: ${{ secrets.GITHUB_TOKEN }}
36+
- name: Extract meta-data for Docker
37+
id: meta
38+
uses: docker/metadata-action@v5
39+
with:
40+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
41+
- name: Set up Docker Build
42+
uses: docker/setup-buildx-action@v3
43+
- name: Build and publish the Docker image
44+
uses: docker/build-push-action@v5
45+
with:
46+
context: services/save-and-restore
47+
push: true
48+
platforms: linux/amd64
49+
tags: ${{ steps.meta.outputs.tags }}
50+
labels: ${{ steps.meta.outputs.labels }}
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max

services/alarm-server/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM eclipse-temurin:17-jre
2+
3+
# deployment unit
4+
COPY target/service-alarm-server-*.jar /alarmserver/service-alarm-server-*.jar
5+
6+
CMD ["java", "-jar", "/alarmserver/service-alarm-server-*.jar"]

0 commit comments

Comments
 (0)