docker-compose启动springboo应用

时间:2020-07-01 20:47:57   收藏:0   阅读:110

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

技术图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!