36. Docker Compose deploys Tomcat

  • Create a named docker-compose.ymlconfiguration files, configuration follows
version: '3.1'
services:
  tomcat:
    restart: always
    image: tomcat
    container_name: tomcat
    ports:
      - 8080:8080
    volumes:
      - ./webapps:/usr/local/tomcat/webapps.dist
    environment:
      TZ: Asia/Shanghai
  • Start the container
docker-compose up -d
  • Stop container
docker-compose down

Guess you like

Origin blog.csdn.net/shujuelin/article/details/108403482