新建文件docker-compose.yml
version: '2.2'
services:
项目名字:
container_name: 项目名字
image: java:8
ports:
- "8086:8080"
- "9500:8900"
restart: always
volumes:
- xxxx/data:/app/xxx
entrypoint: ["java","-jar","-Dfile.encoding=UTF-8", "-Dspring.config.additional-location=/app/xxx/config/application.yml","-Xms2048m","-Xmx2048m","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=xxx","/app/xxx/xxxx.jar"]
当前目录执行命令docker-compose -f docker-compose.yml up -d
docker restart xxxxx