简体   繁体   English

使用 docker-compose 文件启动 Tryton 服务器

[英]Starting Tryton server with docker-compose file

I am trying to link an external postgres to tryton/tryton from docker hub.我正在尝试将外部 postgres 链接到来自 docker hub 的 tryton/tryton。

docker-compose.yaml docker-compose.yaml

version: '3.7'

services:
  tryton-postgres:
    image: postgres
    ports:
      - 5432:5432
    environment:
      - POSTGRES_PASSWORD=password
      - POSTGRES_DB=tryton
    restart: always

  gnuserver:
    image: tryton/tryton:4.6
    links:
      - tryton-postgres:postgres
    ports:
      - 8000:8000
    depends_on:
      - tryton-postgres
    entrypoint: /entrypoint.sh trytond

when i ssh into the container and run trytond-admin --all -d tryton it seems to be looking for sqlite file instead of the connected postgres database.当我通过 ssh 进入容器并运行trytond-admin --all -d tryton它似乎在寻找 sqlite 文件而不是连接的 postgres 数据库。 Are there some env variagbles i must set?我必须设置一些环境变量吗? What am i missing in my docker compose file?我的 docker compose 文件中缺少什么?

Instead of changing the configuration file, with Docker it is simpler to set environment variable like:与更改配置文件不同,使用 Docker 可以更简单地设置环境变量,例如:

DB_USER=
DB_PASSWORD=
DB_HOSTNAME=tryton-postgres
DB_PORT=5432

you need to edit /etc/tryton/trytond.conf to look at postgresql :你需要编辑/etc/tryton/trytond.conf来查看postgresql

uri = postgresql://USERNAME:PASSWORD@tryton-postgres:5432/

see the Docs查看文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM