forked from mj/devopsscripts
29 lines
1.0 KiB
Docker
29 lines
1.0 KiB
Docker
FROM harbor.zzmjart.com/library/compile:1.0.0 as builder
|
|
COPY .git .git
|
|
COPY src src
|
|
COPY pom.xml .
|
|
COPY settings.xml .
|
|
RUN mvn -s ./settings.xml clean package -DskipTests=true
|
|
|
|
|
|
FROM harbor.zzmjart.com/library/java17:1.0.0
|
|
ARG PROJECTCODE
|
|
ARG PROJECTVERSION
|
|
LABEL author=wangchuan<wangzefu520@163.com>
|
|
COPY docker-entrypoint.sh /usr/local/bin/
|
|
COPY --from=builder /opt/app/target/*.jar $APP_HOME
|
|
ENV ENV_ACTIVE="prod" \
|
|
PROJECT_NAME="${PROJECTCODE}" \
|
|
PROJECT_VERSION="${PROJECTVERSION}" \
|
|
JAVA_OPS="" \
|
|
APP_OPS="" \
|
|
SKYWALKING_OPS="" \
|
|
GC_OPS="-XX:+UseG1GC -XX:+UseStringDeduplication -XX:+OptimizeStringConcat -XX:+HeapDumpOnOutOfMemoryError -Xlog:gc*=info:file=$LOGS_HOME/gc.log:time,level,tags:filecount=30,filesize=50M -XX:HeapDumpPath=$LOGS_HOME/app.dump"
|
|
RUN addgroup -g 1000 1000 && \
|
|
adduser -u 1000 -G 1000 -S -D -H 1000 && \
|
|
chown 1000:1000 -R $APP_HOME $LOGS_HOME && \
|
|
chmod 744 /usr/local/bin/docker-entrypoint.sh && \
|
|
chmod 444 $APP_HOME/*.jar
|
|
WORKDIR $APP_HOME
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|