You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
735 B
Docker
24 lines
735 B
Docker
1 year ago
|
## AdoptOpenJDK 停止发布 OpenJDK 二进制,而 Eclipse Temurin 是它的延伸,提供更好的稳定性
|
||
1 year ago
|
## 感谢复旦核博士的建议!灰子哥,牛皮!
|
||
|
FROM eclipse-temurin:8-jre
|
||
1 year ago
|
|
||
|
## 创建目录,并使用它作为工作目录
|
||
1 year ago
|
RUN mkdir -p /yudao-server
|
||
|
WORKDIR /yudao-server
|
||
1 year ago
|
## 将后端项目的 Jar 文件,复制到镜像中
|
||
1 year ago
|
COPY ./target/yudao-server.jar app.jar
|
||
1 year ago
|
|
||
|
## 设置 TZ 时区
|
||
1 year ago
|
ENV TZ=Asia/Shanghai
|
||
1 year ago
|
## 设置 JAVA_OPTS 环境变量,可通过 docker run -e "JAVA_OPTS=" 进行覆盖
|
||
1 year ago
|
ENV JAVA_OPTS="-Xms512m -Xmx512m -Djava.security.egd=file:/dev/./urandom"
|
||
|
|
||
|
## 应用参数
|
||
|
ENV ARGS=""
|
||
1 year ago
|
|
||
|
## 暴露后端项目的 48080 端口
|
||
1 year ago
|
EXPOSE 48080
|
||
1 year ago
|
|
||
|
## 启动后端项目
|
||
1 year ago
|
CMD java ${JAVA_OPTS} -jar app.jar $ARGS
|