-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add main Dockerfile Fix annotation
- Loading branch information
Showing
5 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
name: ci | ||
|
||
on: push | ||
|
||
env: | ||
GROUP: senacor | ||
COMMIT_SHA: ${{ github.sha }} | ||
REPO: simple-provider | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2 | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
|
||
- name: Build + verify | ||
run: mvn -B verify | ||
|
||
docker: | ||
needs: | ||
- test | ||
runs-on: ubuntu-latest | ||
env: | ||
PUSH_DOCKER_IMAGE: true | ||
DOCKER_NAME: ghcr.io/${{ github.repository }} | ||
DOCKER_REGISTRY: ghcr.io | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Package | ||
run: mvn -B package -DskipTests -DskipITs | ||
|
||
- name: "Docker: Set up QEMU" | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: "Docker: Set up Docker Buildx" | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: "Docker: Login to Container Registry" | ||
uses: docker/login-action@v1 | ||
if: env.PUSH_DOCKER_IMAGE == 'true' | ||
with: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
registry: ${{ env.DOCKER_REGISTRY }} | ||
|
||
- name: "Docker: Build and push to Container Registry" | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
tags: | | ||
${{ env.DOCKER_NAME }}:${{ env.COMMIT_SHA }} | ||
push: ${{ env.PUSH_DOCKER_IMAGE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM adoptopenjdk/openjdk11:jre-11.0.10_9-alpine | ||
|
||
|
||
RUN mkdir /app | ||
COPY target/com.senacor.ci.simple-provider.jar /app/ | ||
COPY launch.sh /app/ | ||
|
||
EXPOSE 8080 | ||
|
||
WORKDIR /app | ||
CMD ["bash", "launch.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
export | ||
JAVA_OPTS=$(eval echo $JAVA_OPTS) | ||
JAVA_OPTS="$JAVA_OPTS -XshowSettings:vm" | ||
JAVA_OPTS="$JAVA_OPTS -XX:+UseContainerSupport" | ||
JAVA_OPTS="$JAVA_OPTS -XX:InitialRAMPercentage=60.0" | ||
JAVA_OPTS="$JAVA_OPTS -XX:MaxRAMPercentage=60.0" | ||
JAVA_OPTS="$JAVA_OPTS -XX:+UseG1GC" | ||
JAVA_OPTS="$JAVA_OPTS -XX:+ExitOnOutOfMemoryError" | ||
JAVA_OPTS="$JAVA_OPTS -Dfile.encoding=UTF-8" | ||
|
||
echo JAVA_OPTS: $JAVA_OPTS | ||
echo Starting: "java $JAVA_OPTS -jar /app/com.senacor.ci.simple-provider.jar" | ||
|
||
exec java $JAVA_OPTS -Dfile.encoding=UTF-8 -jar /app/com.senacor.ci.simple-provider.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters