Docker:如何将子文件夹安装到目录中同时将文件夹安装到另一个目录中?

时间:2019-05-29 13:22:03

标签: docker volume mount

我在NAS上使用nextcloud docker。将主机上的/ mnt / 4tb挂载到docker上的/ var / www / html是可以的。但是我想要的是将docker上的/ var / www / html / data绑定到主机上的/ mnt / 4tb(这是一个大硬盘)上,以存储“实际”文件(照片,视频等)并进行绑定将卷app_data放置到docker上的/ var / www / html上以存储剩余文件( .html, .log,*。php等)。

这是docker-compose.yml文件:

version: '3'
services:
  nextcloud:
    container_name: nextcloud-server
    #image: nextcloud:fpm
    build: ./nextcloud-smbclient
    stdin_open: true
    tty: true
    restart: always
    expose:
      - '80'
      - '9000'
    networks:
      - onlyoffice
    volumes:
      - /etc/timezone:/etc/timezone
      - /etc/localtime:/etc/localtime
      - ./mnt/4tb:/var/www/html/data
      - app_data:/var/www/html

  onlyoffice-document-server:
  #  <...>

  nginx:
    container_name: nginx-server
    image: nginx
    stdin_open: true
    tty: true
    restart: always
    ports:
      - 8080:8080
      - 8443:8443
    networks:
      - onlyoffice
    volumes:
      - /etc/timezone:/etc/timezone
      - /etc/localtime:/etc/localtime
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/conf.d:/etc/nginx/conf.d
      - /etc/letsencrypt:/etc/letsencrypt
      - /var/log/nginx-docker:/var/log/nginx
      - ./mnt/4tb:/var/www/html/data
      - app_data:/var/www/html

  db:
  ## <...>

networks:
  onlyoffice:
    driver: 'bridge'

volumes:
  document_data:
  document_log:
  app_data:
  mysql_data:

我得到了以下日志:

root@OMV:~/docker-onlyoffice-owncloud# docker logs nextcloud-server
[29-May-2019 19:56:05] NOTICE: fpm is running, pid 1
[29-May-2019 19:56:05] NOTICE: ready to handle connections
172.23.0.2 -  29/May/2019:19:58:31 +0800 "GET /index.php" 500
172.23.0.2 -  29/May/2019:19:58:32 +0800 "GET /core/templates/404.php" 200
172.23.0.2 - admin 29/May/2019:21:26:37 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:26:37 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:26:46 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:26:46 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:26:59 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:36:23 +0800 "GET /index.php" 500
172.23.0.2 -  29/May/2019:21:39:00 +0800 "GET /core/templates/404.php" 200
172.23.0.2 - admin 29/May/2019:21:46:55 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:51:30 +0800 "GET /index.php" 500
172.23.0.2 - admin 29/May/2019:21:57:03 +0800 "GET /index.php" 500

并收到错误消息:

  

内部服务器错误服务器遇到内部错误,并且被   无法完成您的请求。请联系服务器   管理员,如果此错误再次出现,请附上   报告中下面的技术详细信息。可以找到更多详细信息   在服务器日志中。

我该怎么办?

谢谢。

0 个答案:

没有答案