# docker build -t registry.cn-hangzhou.aliyuncs.com/awl/base2024-api:0.1 .
FROM registry.cn-hangzhou.aliyuncs.com/awl/openjdk:8u342-jre
#FROM openjdk:17-alpine

MAINTAINER jlzhou

RUN mkdir -p /server/logs \
    /server/tmp \
    /server/config \
    /server/lib \
    /server/upload

WORKDIR /server

ENV SERVER_PORT=8080

EXPOSE ${SERVER_PORT}

ADD ./target/lib/ ./lib/
ADD ./target/ruoyi-admin.jar ./app.jar

ENTRYPOINT ["java", \
            "-Dloader.path=./lib/", \
            "-Djava.security.egd=file:/dev/./urandom", \
            "-Duser.timezone=GMT+08", \
            "-Dserver.port=${SERVER_PORT}", \
            "-Dspring.profiles.active=prod", \
#            "--add-opens java.base/java.lang=ALL-UNNAMED", \
#            "--add-opens java.base/java.lang.reflect=ALL-UNNAMED", \
#            "--add-opens java.base/java.lang.invoke=ALL-UNNAMED", \
#            "--add-opens java.base/java.math=ALL-UNNAMED", \
#            "--add-opens java.base/sun.net.util=ALL-UNNAMED", \
#            "--add-opens java.base/java.io=ALL-UNNAMED", \
#            "--add-opens java.base/java.net=ALL-UNNAMED", \
#            "--add-opens java.base/java.nio=ALL-UNNAMED", \
#            "--add-opens java.base/java.security=ALL-UNNAMED", \
#            "--add-opens java.base/java.text=ALL-UNNAMED", \
#            "--add-opens java.base/java.time=ALL-UNNAMED", \
#            "--add-opens java.base/java.util=ALL-UNNAMED", \
            # 应用名称 如果想区分集群节点监控 改成不同的名称即可
#            "-Dskywalking.agent.service_name=ruoyi-server", \
#            "-javaagent:/ruoyi/skywalking/agent/skywalking-agent.jar", \
            "-jar", "app.jar"]
