一、编写Compose文件
version: "3.6" services: another-iotproject: build: . command: java -Dfile.encoding=UTF-8 -jar /iotProject.jar ports: - target: 8080 published: 8081 networks: - another-net volumes: - type: volume source: iotProject-logs target: /iotProject-logs networks: another-net: {} volumes: iotProject-logs: {}
二、关键 4 Keys
key名称 | 解释 |
version | 文件格式版本,详情参见对应表 |
services | 要开启的容器 |
networks | 默认 |
volumes | 挂载卷 |
三、部署
docker-compose up &