2024-08-21 16:28:56 +08:00
|
|
|
FROM openjdk:8-jre
|
2024-08-13 14:36:48 +08:00
|
|
|
|
|
|
|
## 创建目录,并使用它作为工作目录
|
|
|
|
RUN mkdir -p /ludu-job-admin-biz
|
|
|
|
WORKDIR /ludu-job-admin-biz
|
|
|
|
## 将后端项目的 Jar 文件,复制到镜像中
|
|
|
|
COPY ./target/ludu-job-admin-biz.jar app.jar
|
|
|
|
|
|
|
|
## 设置 TZ 时区
|
2024-08-14 09:23:39 +08:00
|
|
|
ENV TZ=Asia/Shanghai
|
2024-08-13 14:36:48 +08:00
|
|
|
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
2024-08-21 16:28:56 +08:00
|
|
|
ENV JAVA_OPTS="-Xms256m -Xmx256m -Djava.security.egd=file:/dev/./urandom"
|
2024-08-13 14:36:48 +08:00
|
|
|
|
|
|
|
## 暴露后端项目的 9090 端口
|
2024-08-21 16:28:56 +08:00
|
|
|
EXPOSE 48084
|
2024-08-13 14:36:48 +08:00
|
|
|
|
|
|
|
## 启动后端项目
|
2024-08-14 09:23:39 +08:00
|
|
|
CMD java ${JAVA_OPTS} -jar app.jar
|