version: '3'

services:
  mysql:
    container_name: jjit_mysql
    restart: always
    image: mysql:5.7
    ports:
      - 3306:3306
    volumes:
      - ./mysql/data:/var/lib/mysql
      - ./mysql/my.cnf:/etc/my.cnf
    environment:
      MYSQL_ROOT_PASSWORD: password

  nginx:
    container_name: jjit_nginx
    restart: always
    image: nginx:latest
    ports:
      - 80:80
      - 443:443
    volumes:
      - ./nginx/www:/usr/share/nginx/html
      - ./nginx/conf.d:/etc/nginx/conf.d
      - ./nginx/cert:/etc/nginx/cert
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/log/error.log:/var/log/nginx/error.log
    links:
      - tomcat:t1

  tomcat:
    container_name: jjit_tomcat
    restart: always
    image: tomcat:latest
    ports:
      - 8080:8080
      - 8009:8009
      - 8443:8443
    volumes:
      - ./tomcat/webapps:/usr/local/tomcat/webapps
      - ./tomcat/conf:/usr/local/tomcat/conf
      - ./tomcat/logs:/usr/local/tomcat/logs
    links:
      - mysql:m1

标签: linux, tomcat, 服务器, docker, mysql, nginx

添加新评论