feat: docker文件优化

V0.5.x
jay 2023-08-04 16:42:57 +08:00
parent 670836f6bf
commit c848651bf8
2 changed files with 26 additions and 1 deletions

View File

@ -1,6 +1,6 @@
FROM openjdk:11-jre-slim
WORKDIR /app
ADD iot-starter/target/iot-starter-0.4.5-SNAPSHOT.jar /app
ADD iot-starter/target/iot-starter-0.4.5-SNAPSHOT.jar /app/app.jar
ADD data/init /app/data/init
ADD data/components /app/data/components
ADD data/converters /app/data/converters

View File

@ -0,0 +1,25 @@
version: "3"
services:
iita-app:
container_name: iita-app
# 改成你自己的镜像
image: 75509151/iita-app:0.5.4
# 构建镜像时使用
build:
context: ""
dockerfile: Dockerfile
restart: always
# 使用主机端口
network_mode: "host"
volumes:
# - ./admin-service.jar:/admin-service.jar
- /app/data:/app/data/
- /app/config:/app/config/
- /app/log:/app/log/
command:
- /bin/sh
- -c
- |
echo "Asia/Shanghai" > /etc/timezone
java -DdisabledEmbeddedRedis=true -Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -server -Xmx512m -Xms512m -Xmn256m -Xss256k -Dlogging.path=/app/log/ -Dspring.config.location=/app/config/ -jar /app/app.jar