version: '3' services: app: container_name: app-server image: nextcloud:fpm stdin_open: true tty: true restart: always expose: - '80' - '9000' networks: - onlyoffice volumes: - app_data:/var/www/html onlyoffice-document-server: container_name: onlyoffice-document-server image: onlyoffice/documentserver:latest stdin_open: true tty: true restart: always networks: - onlyoffice expose: - '80' - '443' volumes: - document_data:/var/www/onlyoffice/Data - document_log:/var/log/onlyoffice nginx: container_name: nginx-server image: nginx stdin_open: true tty: true restart: always ports: - 80:80 - 443:443 networks: - onlyoffice volumes: - .\nginx.conf:/etc/nginx/nginx.conf - app_data:/var/www/html db: container_name: mariadb image: mariadb restart: always volumes: - mysql_data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=MyR00tSQ1! - MYSQL_PASSWORD=N3xtCl0ud! - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - TZ: Asia/Shanghai networks: - onlyoffice networks: onlyoffice: driver: 'bridge' volumes:
一直提示 ERROR: In file '.\docker-compose.yml', volume must be a mapping, not an array.
1
263 2021-08-04 14:21:57 +08:00
volume 搞反了吧,容器里面怎么有 windows 的路径。
|
2
sjmcefc2 OP volumes:
D://docker/onlyoffice/document_data:document_data D://docker/onlyoffice/document_log:document_log D://docker/onlyoffice/app_data:app_data D://docker/onlyoffice/mysql_data:mysql_data |
3
chotow 2021-08-04 14:33:15 +08:00
https://docs.docker.com/compose/compose-file/compose-file-v3/#volume-configuration-reference
顶级 volumes 字段不能用数组形式,详情见以上链接。 |
4
sjmcefc2 OP 这样?
|
5
sjmcefc2 OP volumes:
data: external: document_data: D://docker/onlyoffice/document_data document_log:D://docker/onlyoffice/document_log app_data:D://docker/onlyoffice/app_data mysql_data:D://docker/onlyoffice/mysql_data ERROR: Error while attempting to convert volume.data.external to appropriate type: "document_data:d://docker/onlyoffice/document_data document_log:d://docker/onlyoffice/document_log app_data:d://docker/onlyoffice/app_data mysql_data:d://docker/onlyoffice/mysql_data" is not a valid boolean value |
6
263 2021-08-04 14:56:23 +08:00
看的眼花,貌似看错了,正常排版的 docker-compose.yml 能来一个么。
|
7
sjmcefc2 OP version: '3'
services: app: container_name: app-server image: nextcloud:fpm stdin_open: true tty: true restart: always expose: - '80' - '9000' networks: - onlyoffice volumes: - app_data:/var/www/html onlyoffice-document-server: container_name: onlyoffice-document-server image: onlyoffice/documentserver:latest stdin_open: true tty: true restart: always networks: - onlyoffice expose: - '80' - '443' volumes: - document_data:/var/www/onlyoffice/Data - document_log:/var/log/onlyoffice nginx: container_name: nginx-server image: nginx stdin_open: true tty: true restart: always ports: - 80:80 - 443:443 networks: - onlyoffice volumes: - .\nginx.conf:/etc/nginx/nginx.conf - app_data:/var/www/html db: container_name: mariadb image: mariadb restart: always volumes: - mysql_data:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=MyR00tSQ1! - MYSQL_PASSWORD=N3xtCl0ud! - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud - TZ: Asia/Shanghai networks: - onlyoffice networks: onlyoffice: driver: 'bridge' volumes: data: external: document_data:D://docker/onlyoffice/document_data document_log:D://docker/onlyoffice/document_log app_data:D://docker/onlyoffice/app_data mysql_data:D://docker/onlyoffice/mysql_data |
8
sjmcefc2 OP 这个原来在 linux 的版本,我修改成 windows 版本。
|
9
zjj19950716 2021-08-04 16:08:26 +08:00
顶级的 volume 还能 bind 宿主机目录吗
|
10
263 2021-08-04 16:39:25 +08:00 1
volumes:
document_data: driver: local driver_opts: o: bind type: none device: D:/docker/onlyoffice/document_data document_log: driver: local driver_opts: o: bind type: none device: D:/docker/onlyoffice/document_log app_data: driver: local driver_opts: o: bind type: none device: D:/docker/onlyoffice/app_data mysql_data: driver: local driver_opts: o: bind type: none device: D:/docker/onlyoffice/mysql_data |
12
chenjunqiang 275 天前
|