From 32a02b5306c687ed87f76711e48ef572bdfa3e94 Mon Sep 17 00:00:00 2001 From: sinergia Date: Mon, 14 Aug 2023 11:48:07 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20Se=20actualiza=20README.md=20con=20la=20?= =?UTF-8?q?l=C3=B3gica=20de=20docker-compose?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 146 +++++++++++++++++++++++------------------------------- 1 file changed, 61 insertions(+), 85 deletions(-) diff --git a/README.md b/README.md index 2ffa8fa..55007fd 100644 --- a/README.md +++ b/README.md @@ -31,106 +31,82 @@ git clone https://git.disroot.org/OneTeam/oc-docker-tryton-non-official.git cd oc-docker-tryton-non-official ``` Edit Dockerfile and change lines commented example create Docker OneTeam: + ``` -#version Trytond server example 5.0 -FROM tryton/tryton:6.0 -#lebel custom -LABEL org.label-schema.version="6.0-my-one_team" -#version equal Tryond server version -ENV TRYTOND_VERSION="6.0" -#python version that will run the dockeri, e.g. python3.7 -ENV PYTHON_VERSION="python3.7" -#version equal Tryond server version -ENV GITEA_ORG="OneTeam" -#domain server gitea -ENV GITEA_DOMAIN="git.disroot.org" +#version Trytond server example 6.0 +TRYTOND_VERSION=6.6 +#python version that will run the docker example 3.7 or 3.9 is mandatory in case you use tryton6.2 +PYTHON_VERSION=3.9 #if the module repository is private -ENV GITEA_USER="my-user" -ENV GITEA_PASSWORD="my-password" -ENV GITEA_ACCESS_TOKEN="45454515415465456456" -#By default all organizations are set to false, activate only one as true. -ENV GnuHealth="False" -ENV Etrivial="False" -ENV Trytonar="False" -ENV OneTeam="True" -ENV Presik="False" -ENV Datalife="False" -ENV NaNtic="False" -ENV Kalenis="False" +GITEA_USER=gitea_user +GITEA_PASSWORD=gitea_password +GITEA_ACCESS_TOKEN=gitea_user_token +#Repository Multi Migrate +REPO_MULTI_MIGRATE=OneTeam/oc-multi_migrate_to_gitea.git +#domain server gitea +GITEA_DOMAIN=git.disroot.org +URL_MULTI_MIGRATE=https://${GITEA_USER}:${GITEA_PASSWORD}@${GITEA_DOMAIN}/OneTeam/oc-multi_migrate_to_gitea.git +#By default all organizations are set to false, activate only one. +#GnuHealth, Etrivial, tryton-ar, OneTeam, OneTeam_Pos, Presik, Datalife, NaNtic, Kalenis +Provider=OneTeam +DIR_MODULES=/usr/local/lib/python${PYTHON_VERSION}/dist-packages/trytond/modules +DB_PASSWORD=SUp3r-pass*DB +POSTGRES_DB=tryton +DB_HOSTNAME=db +POSTGRES_PASSWORD=SUp3r-pass*DB +TRYTON_PORT=8000 +DEVELOP=True +WORKER=True +TRYTONPASSFILE=/etc/trytond_admin_pass.conf +#Password user admin +TRYTONADMINPASS=admin +#Email user admin +EMAIL=admin@admin.com +SLEEP_TRYTOND_ADMIN=15 +#SMTP +#This value is True or False +SMTP=False +SMTP_TYPE=smtps+ssl +SMTP_USER= +SMTP_PASSWORD= +SMTP_DOMAIN= +SMTP_PORT=465 +SMTP_FROM=NAME_FROM +SMTP_EMAIL= ``` + # Usage -``` -docker build -t tryton/label . -``` + +Building a profil. **Note: in case of than you need rebuild your docker image from the beginning, we will have add the option '--no-cache'** - -Create a network of work for docker: ``` -docker network create name_network -``` -Create a volumen of storage for docker: - - -``` -docker volume create name_volume -``` -Export of variable of environment with password for our postgres, it is with the purpose of don't have to write many time the password - - -``` -export POSTGRES_PASSWORD="password" +docker-compose -p build --no-cache --progress plain ``` -Create a postgres docker image - +Create a project with the previous profile built ``` -docker run \ - --name name_docker_postgres \ - --env PGDATA=/var/lib/postgresql/data/pgdata\ - --env POSTGRES_DB=name_database\ - --env POSTGRES_PASSWORD=${POSTGRES_PASSWORD}\ - --mount source=name_volume,target=/var/lib/postgresql/data\ - --network name_network\ - --detach\ - postgres - -``` -Create a database in our docker postgres image - -``` -docker exec --user postgres name_docker_postgres createdb name_database - +docker-compose -p up -d ``` -fill the database with data +# Bassic Commands. +Enter tryton docker service bash. +**Note: +'tryton' is the name assigned into docker-compose.yml for th docker service of tryton, +'/entrypoint.sh' it is import for load environment variables, +'--user' specifies the user. +** ``` -docker run \ - --env DB_HOSTNAME=name_docker_postgres\ - --env DB_PASSWORD=${POSTGRES_PASSWORD}\ - --network name_network\ - --interactive\ - --tty\ - --rm\ - tryton/label\ - trytond-admin -d name_database -vv --all +docker-compose -p exec --user root tryton /entrypoint.sh bash +``` +Update list of modules ``` - -Run docker image with our tryton - -``` -docker run\ - --name name_docker_tryton\ - --env DB_HOSTNAME=name_docker_postgres\ - --env DB_PASSWORD=${POSTGRES_PASSWORD}\ - --network name_network\ - --publish 127.0.0.1:8000:8000\ - --detach\ - tryton/label - +docker-compose -p exec --user root tryton /entrypoint.sh trytond-admin -c /etc/trytond.conf -d -vv -m --all ``` -This guide refer to https://discuss.tryton.org/t/how-to-run-tryton-using-docker/3200, -in case of any question it is recommended read https://docs.docker.com/get-started/ +Enter postgres docker service psql. +``` +docker-compose -p exec --user postgres db psql +```