oc-docker-tryton-non-official/README.md

131 lines
3.1 KiB
Markdown
Raw Normal View History

2022-01-06 17:05:46 +01:00
# Description
2022-01-05 23:19:00 +01:00
Docker tryton-non_official It is a tool for deploying unofficial Tryton modules in Docker, including:
1. Gnuhealth
2. Kalenis
3. NaNtic
4. Datalife
5. Presik
6. Trytonar
7. Onecluster
8. Etrivial
2022-01-19 20:22:46 +01:00
> Gnuhealth y Etrivial most be work whit tryton5.0
2022-01-05 23:19:00 +01:00
# Dependencies:
Have **docker** 20 or higher installed and **git**
2022-01-12 16:20:19 +01:00
[Multi migrate to gitea](https://git.disroot.org/OneCluster/oc-multi_migrate_to_gitea) will be called at the time of the creation of the docker
2022-01-05 23:19:00 +01:00
# Prerequisites
Clone repository:
```
git clone https://gitea.onecluster.org/OneCluster/oc-docker-tryton-non-official.git
2022-01-19 20:22:46 +01:00
cd oc-docker-tryton-non-official
2022-01-05 23:19:00 +01:00
```
2022-01-06 03:16:55 +01:00
Edit Dockerfile and change lines commented example create Docker OneCluster:
```
#version Trytond server example 5.0
FROM tryton/tryton:6.0
#lebel custom
LABEL org.label-schema.version="6.0-my-one_cluster"
#version equal Tryond server version
ENV TRYTOND_VERSION="6.0"
#python version that will run the docker example python3.7
ENV PYTHON_VERSION="python3.7"
#version equal Tryond server version
2022-01-06 17:05:46 +01:00
ENV GITEA_ORG="OneCluster"
2022-01-06 03:16:55 +01:00
#domain server gitea
ENV GITEA_DOMAIN="git.disroot.org"
#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 OneCluster="True"
ENV Presik="False"
ENV Datalife="False"
ENV NaNtic="False"
ENV Kalenis="False"
```
2022-01-05 23:19:00 +01:00
# Usage
```
2022-01-06 21:56:32 +01:00
docker build -t tryton/non_official .
```
2022-01-06 22:28:39 +01:00
**Note: in case of than you need rebuild your docker image from the beginning, we will have add the option '--no-cache'**
2022-01-06 21:56:32 +01:00
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
```
2022-01-06 23:16:21 +01:00
export POSTGRES_PASSWORD="password"
2022-01-06 21:56:32 +01:00
```
Create a postgres docker image
```
docker run \
2022-01-06 22:20:51 +01:00
--name name_docker_postgres
--env PGDATA=/var/lib/postgresql_docker/data/pgdata\
--env POSTGRES_DB=tryton\
--env POSTGRES_PASSWORD=${POSTGRES_PASSWORD}\
2022-01-06 23:16:21 +01:00
--mount source=tryton-databse,target=/var/lib/postgresql_docker/data\
2022-01-06 22:20:51 +01:00
--network name_network\
--detach\
postgres
2022-01-06 21:56:32 +01:00
```
2022-01-06 22:20:51 +01:00
Create a database in our docker postgres image
2022-01-06 21:56:32 +01:00
2022-01-06 22:20:51 +01:00
```
docker exec --user postgres name_docker_postgres createdb name_database
```
fill the database with data
```
docker run \
--env DB_HOSTNAME=name_docker_postgres\
--env DB_PASSWORD=${POSTGRES_PASSWORD}\
--network name_network\
--interactive\
--tty\
--rm\
tryton/tryton\
trytond-admin -d name_database -vv --all
```
Run docker image with our tryton
```
docker run\
--name name_docker_tryton\
2022-01-06 23:16:21 +01:00
--env DB_HOSTNAME=name_docker_postgres\
2022-01-06 22:20:51 +01:00
--env DB_PASSWORD=${POSTGRES_PASSWORD}\
--network name_network\
--publish 127.0.0.1:8000:8000\
--detach\
tryton/non_official
```
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/