docker-compose启动springboo应用

2021-05-01 04:28

阅读:567

标签:java_opts   nbsp   time   jar   spring   app   boot   start   volumes   

Dockerfile文件:

FROM openjdk:8-jdk

ADD ./myweb.jar app.jar

EXPOSE 701

ENTRYPOINT ["java","-jar","app.jar"]

docker-compose.yml文件:

version: "3"
services:
  myweb:
    build:
      context: .
      dockerfile: Dockerfile
    image: myweb:1.0.0
    container_name: springboot-mybatis
    ports:
      - "701:701"
    volumes:
      - /etc/localtime:/etc/localtime
      - $PWD/logs:/logs
    restart: always
    environment:
      - JAVA_OPTS=-Xmx256M
      - spring.profiles.active=test

启动springboot应用:

docker-compose up

技术图片

 

docker-compose启动springboo应用

标签:java_opts   nbsp   time   jar   spring   app   boot   start   volumes   

原文地址:https://www.cnblogs.com/zhi-leaf/p/13220884.html


评论


亲,登录后才可以留言!