使用docker-compose文件启动Tryton服务器 [英] Starting Tryton server with docker-compose file
本文介绍了使用docker-compose文件启动Tryton服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将外部postgres从docker hub链接到tryton / tryton。
I am trying to link an external postgres to tryton/tryton from docker hub.
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
当我ssh进入容器并运行 trytond-admin --all -d tryton
似乎正在寻找sqlite文件而不是连接的postgres数据库。我必须设置一些环境变量吗?我在docker撰写文件中缺少什么?
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. Are there some env variagbles i must set? What am i missing in my docker compose file?
推荐答案
使用Docker无需更改配置文件,而是更容易设置环境像这样的变量:
Instead of changing the configuration file, with Docker it is simpler to set environment variable like:
DB_USER=
DB_PASSWORD=
DB_HOSTNAME=tryton-postgres
DB_PORT=5432
这篇关于使用docker-compose文件启动Tryton服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文