version: "3"
services:

  file-preview:
    # 指定容器名称
    container_name: file-preview
    # 重启机制
    restart: always
    network_mode: "host"
    build:
      context: ./         # 指定设定上下文根目录,然后以该目录为准寻找Dockerfile
      dockerfile: Dockerfile  #DockerFile 真正所在位置
    image: file-preview:0.0.1
    volumes:
      # 挂载日志 -v A:B ,A指宿主机位置,B指容器位置
      - /usr/local/youxianxin/service/log/file-preview:/logback
      # 指定容器时间为宿主机时间
      - /etc/localtime:/etc/localtime
    #启动容器后执行的命令