odoo部署遇到的问题 yaml.parser.ParserError
ERROR: yaml.parser.ParserError: while parsing a block mapping in "./docker-compose.yml", line 15
在写docker-compose.yml文件
version: '2' services: # PostgreSQL mydb: image: postgres:10 ports: - "5432:5432" environment: - POSTGRES_DB=postgres - POSTGRES_USER=odoo - POSTGRES_PASSWORD=odoo volumes: - odoo-db-data:/var/lib/postgresql/data # Odoo web web: build: context: ../odoo_demo dockerfile: Dockerfile hostname: web command: ./docker_run_web.sh volumes: - ../odoo_demo:/app # mount current directory inside container - odoo-web-data:/app/odoo-web-db # 把此路径/app/odoo-ee-web-db配置到odoo conf data_dir参数中 ports: - "8069:8069" # set up links so that web knows about db, rabbit and redis depends_on: - mydb volumes: odoo-web-data: odoo-db-data:
文件写完运行
docker-compose up -d
报错:
ERROR: yaml.parser.ParserError: while parsing a block mapping in "./docker-compose.yml", line 15, column 5 expected <block end>, but found '<block mapping start>' in "./docker-compose.yml", line 25, column 4
查看发现问题(vim)
原因文件内块对齐有问题,使用notepad++打开查看如下:
volumes:
- ../odoo_demo:/app # mount current directory inside container - odoo-web-data:/app/odoo-web-db # 把此路径/app/odoo-ee-web-db配置到odoo conf data_dir参数中
解决办法:
在下面这句话前面添加两个空格,使他能和上面保持对其
- odoo-web-data:/app/odoo-web-db # 把此路径/app/odoo-ee-web-db配置到odoo conf data_dir参数中
相关推荐
zjuwangleicn 2020-08-17
DumbbellYang 2020-06-11
huacuilaifa 2020-06-10
huacuilaifa 2020-06-09
hellobabygogo 2020-06-09
Java学习 2020-05-11
数据库之扑朔迷离 2020-02-17
katyusha 2020-02-14
ericxieforever 2020-02-13
talkincode 2020-01-11
85580593 2019-08-07
Pythonjeff远 2015-03-01
拼命工作好好玩 2019-07-01
Kwong 2019-06-26
cncici 2018-09-26
lqxqust 2016-03-09
xxg 2015-06-06
张旭 2018-05-05
学无紫晶 2019-01-25