Skip to content

Commit

Permalink
Merge pull request #24 from CodeRusher/main
Browse files Browse the repository at this point in the history
ci(docker): Dockerfile
  • Loading branch information
famosss authored Feb 6, 2024
2 parents f756eae + 516761c commit e9c6007
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM openjdk:17
WORKDIR /wd
ARG env=prod
COPY *.jar app.jar
ENV ENV=$env
ENV JVM_OPTS="\
-Xmx1g \
-XX:MaxRAMPercentage=75 \
-XX:InitialRAMPercentage=75 \
-XX:NativeMemoryTracking=summary \
-XX:+UseG1GC \
-XX:G1HeapRegionSize=16m \
-XX:+UseCompressedClassPointers \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=/wd"
ENTRYPOINT java -Dspring.profiles.active=$ENV $JVM_OPTS -jar app.jar
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
JAVAC := javac
JAVA_VERSION := 17

repo ?= hub.17usoft.com/lhhdz/es2ck
repo ?= docker.io/ting001/ckibana
tag ?= latest
platform ?= linux/arm64
env ?= test
Expand All @@ -24,9 +24,9 @@ image-build:
@rm -rf tmp
@docker rmi "$(repo):$(tag)" --force
mkdir tmp && \
cp build/Dockerfile tmp && \
cp Dockerfile tmp && \
cp target/*.jar tmp && cd tmp && \
docker build --platform $(platform) --build-arg env=$(env) -f Dockerfile -t "$(repo):$(tag)" .
docker build --build-arg env=$(env) -f Dockerfile -t "$(repo):$(tag)" .
@rm -rf tmp

image-run: image-build
Expand Down

0 comments on commit e9c6007

Please sign in to comment.