docker-compose 快速运行java程序

1、任意目录新建docker-compose.yml

touch docker-compose.yml
mdkir config
touch config/application.yml

2、复制jar文件到docker-compose.yml所在目录

cp

3、修改docker-compose.yml

version: '3'

services:
  qyweixin_server:
    image: image: harbor.iotwedora.com:40180/public/openjdk11:latest
    privileged: true
    container_name: qyweixin_server
    restart: always
    network_mode: host
    working_dir: /qyweixin_server
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./config/admin/application.yml:/asp/application.yml:rw
      - ./bin/ruoyi-admin.jar:/asp/server.jar:rw
    command:
      java  -jar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:4001 server.jar --spring.config.location=/asp/application.yml,/asp/application-prod.yml

4、启动程序

docker-compose up -d

posted @ 2023-12-26 09:14  田园将芜胡不归啊  阅读(204)  评论(0编辑  收藏  举报