Docker compose 使用docker compose的Odoo8
我对docker还是个新手。我想使用xgd/Odoo的图像文件制作一个odoo8容器。 下面是我的docker撰写文件。在docker编写yml后不久,web容器死亡,退出代码为0 我知道xcgd/odoo需要链接db容器,我在文档中看到过Docker compose 使用docker compose的Odoo8,docker-compose,odoo,odoo-8,Docker Compose,Odoo,Odoo 8,我对docker还是个新手。我想使用xgd/Odoo的图像文件制作一个odoo8容器。 下面是我的docker撰写文件。在docker编写yml后不久,web容器死亡,退出代码为0 我知道xcgd/odoo需要链接db容器,我在文档中看到过 $ docker run -p 8069:8069 --rm --name="xcgd.odoo" --link pg93:db xcgd/odoo:7.0 start 我的yaml中是否缺少此链接?我想我已经用网络定义了链接 有人能指出我的错误吗 我的y
$ docker run -p 8069:8069 --rm --name="xcgd.odoo" --link pg93:db xcgd/odoo:7.0 start
我的yaml中是否缺少此链接?我想我已经用网络定义了链接
有人能指出我的错误吗
我的yaml文件
version: '3.3'
services:
# Web Application Service Definition
# --------
#
# All of the information needed to start up an odoo web
# application container.
web:
image: xcgd/odoo:8.0
depends_on:
- db
# Port Mapping
# --------
#
# Here we are mapping a port on the host machine (on the left)
# to a port inside of the container (on the right.) The default
# port on Odoo is 8069, so Odoo is running on that port inside
# of the container. But we are going to access it locally on
# our machine from localhost:9000.
#ports:
# - 80:8069
# Data Volumes
# --------
#
# This defines files that we are mapping from the host machine
# into the container.
#
# Right now, we are using it to map a configuration file into
# the container and any extra odoo modules.
volumes:
- ./config:/etc/odoo
- ./addons/logic:/mnt/logic-addons
- ./addons/data:/mnt/data-addons
# Odoo Environment Variables
# --------
# The odoo image uses a few different environment
# variables when running to connect to the postgres
# database.
#
# Make sure that they are the same as the database user
# defined in the db container environment variables.
environment:
- HOST=db
- USER=odoo
- PASSWORD=odoo
- VIRTUAL_HOST=proc.fullertonhealth.co.id
- VIRTUAL_PORT=8069
- LETSENCRYPT_HOST=proc.fullertonhealth.co.id
- LETSENCRYPT_EMAIL=info@fullertonhealth.co.id
expose:
- 8069
# Database Container Service Definition
# --------
#
# All of the information needed to start up a postgresql
# container.
db:
image: postgres:9.5
# Database Environment Variables
# --------
#
# The postgresql image uses a few different environment
# variables when running to create the database. Set the
# username and password of the database user here.
#
# Make sure that they are the same as the database user
# defined in the web container environment variables.
environment:
- POSTGRES_PASSWORD=odoo
- POSTGRES_USER=odoo
- POSTGRES_DB=postgres # Leave this set to postgres
networks:
default:
external:
name: nginx-proxy
您不需要声明端口级连接。Docker compose应该能够从容器的暴露端口获取此信息。检查日志以验证数据库连接是否是实际问题。请发布您得到的实际错误。嗨,原来我必须在web服务中设置命令:“start”
。糟糕的是,我不理解文档中给出的docker run
示例的参数。