我有这个docker-compose文件:
version: '3.7'
services:
db:
image: "postgres:9.6"
container_name: postgres-container
ports: ["6543:5432"]
environment:
- POSTGRES_USER=odoo
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=odoo
restart: always
volumes:
- ./data/postgres:/var/lib/postgresql/data
odoo:
#build: ./odoo-container
image: odoo-image
container_name: odoo-container
ports: ["8069:8069"]
tty: true
command: opt/odoo/odoo-bin -c opt/odoo.conf -d teste
depends_on:
- db
问题是,当我启动Docker compose时,我的db服务运行,而当Docker运行odoo服务时,我得到一个错误:
psycopg2.OperationalError: FATAL: the database system is starting up
而当我重新启动odoo容器时,它的工作原理
1条答案
按热度按时间vtwuwzda1#
im添加了restart方法,并工作: