-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.subscriptions_scheduler
44 lines (34 loc) · 1.72 KB
/
Dockerfile.subscriptions_scheduler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM eclipse-temurin:21.0.2_13-jdk-jammy AS build
#FROM --platform=linux/arm64 gradle:8.6.0-jdk17
ARG SERVICE_NAME=subscriptions_scheduler
COPY ./gradle ./gradle
COPY ./build.gradle ./settings.gradle ./gradlew ./
COPY ./buildSrc ./buildSrc
COPY ./$SERVICE_NAME ./$SERVICE_NAME
RUN ["/bin/bash", "-c", "./gradlew clean bootJar -x test"]
FROM eclipse-temurin:21.0.2_13-jre-alpine
LABEL authors="turtality"
ARG TZ=Europe/Moscow
ENV TZ ${TZ}
ENV SERVICE_NAME=subscriptions_scheduler
ARG JAR_VERSION
ENV ENV_JAR_VERSION $JAR_VERSION
ENV ENV_PATH_BUILD_JAR=$SERVICE_NAME/build/libs/$SERVICE_NAME-$JAR_VERSION.jar
ENV ENV_PATH_TO_JAR=$SERVICE_NAME-$JAR_VERSION.jar
RUN echo "$TZ" > /etc/timezone && apk --no-cache add curl
WORKDIR /app
COPY --from=build ./$ENV_PATH_BUILD_JAR ./
# entrypoint не работает с шеллом, работает только ARG переменные
# не работает с переменными вообще. нужно использовать голый entrypoint
# ENTRYPOINT ["java", "-Djasypt.encryptor.password=${JASYPT_PASSWORD}", "-Djasypt.encryptor.algorithm=PBEWithMD5AndDES", "-Djasypt.encryptor.ivGeneratorClassName=org.jasypt.iv.NoIvGenerator", "-jar", "$ENV_PATH_TO_JAR"]
ENTRYPOINT java -Xms200m -Xmx200m \
-XX:MaxMetaspaceSize=150m \
-XX:NewSize=150m \
-XX:MaxNewSize=150m \
-XX:+UseG1GC \
-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=./dump.hprof \
-XX:+UseGCOverheadLimit \
-XX:+UseStringDeduplication \
-Xlog:gc=info:file=./gc-%p-%t.log:tags,uptime,time,level:filecount=5,filesize=10m \
-jar "$ENV_PATH_TO_JAR"