new docker-compose.yml
This commit is contained in:
parent
c55ccb7067
commit
02095aa054
4 changed files with 107 additions and 32 deletions
27
.env_sample
Normal file
27
.env_sample
Normal file
|
@ -0,0 +1,27 @@
|
|||
#version Trytond server example 5.0
|
||||
TRYTOND_VERSION=""
|
||||
#python version that will run the docker example python3.7 or python3.9 is mandatory in case you use tryton6.2
|
||||
PYTHON_VERSION=""
|
||||
#version equal Tryond server version
|
||||
GITEA_ORG=""
|
||||
#domain server gitea
|
||||
GITEA_DOMAIN=""
|
||||
#if the module repository is private
|
||||
GITEA_USER=""
|
||||
GITEA_PASSWORD=""
|
||||
GITEA_ACCESS_TOKEN=""
|
||||
#By default all organizations are set to false, activate only one as true.
|
||||
GnuHealth="False"
|
||||
Etrivial="False"
|
||||
Trytonar="False"
|
||||
OneTeam="False"
|
||||
OneTeam_pos="False"
|
||||
Presik="False"
|
||||
Datalife="False"
|
||||
NaNtic="False"
|
||||
Kalenis="False"
|
||||
DIR_MODULES="/usr/local/lib/${PYTHON_VERSION}/dist-packages/trytond/modules"
|
||||
DB_PASSWORD=""
|
||||
POSTGRES_DB=""
|
||||
DB_HOSTNAME=""
|
||||
POSTGRES_PASSWORD=""
|
49
Dockerfile
49
Dockerfile
|
@ -1,31 +1,28 @@
|
|||
#version Trytond server example 5.0
|
||||
FROM tryton/tryton:
|
||||
#lebel custom
|
||||
LABEL org.label-schema.version=""
|
||||
#version equal Tryond server version
|
||||
ENV TRYTOND_VERSION=""
|
||||
#python version that will run the docker example python3.7 or python3.9 is mandatory in case you use tryton6.2
|
||||
ENV PYTHON_VERSION=""
|
||||
#version equal Tryond server version
|
||||
ENV GITEA_ORG=""
|
||||
#domain server gitea
|
||||
ENV GITEA_DOMAIN=""
|
||||
#if the module repository is private
|
||||
ENV GITEA_USER=""
|
||||
ENV GITEA_PASSWORD=""
|
||||
ENV GITEA_ACCESS_TOKEN=""
|
||||
ARG TRYTOND_VERSION
|
||||
|
||||
FROM tryton/tryton:$TRYTOND_VERSION
|
||||
#lebel custom
|
||||
LABEL org.label-schema.version="$TRYTON_VERSION"
|
||||
|
||||
ARG TRYTOND_VERSION
|
||||
ARG PYTHON_VERSION
|
||||
ARG OneTeam
|
||||
ARG GnuHealth
|
||||
ARG Etrivial
|
||||
ARG Trytonar
|
||||
ARG OneTeam_pos
|
||||
ARG Presik
|
||||
ARG Datalife
|
||||
ARG NaNtic
|
||||
ARG Kalenis
|
||||
ARG GITEA_ORG
|
||||
ARG GITEA_DOMAIN
|
||||
ARG GITEA_USER
|
||||
ARG GITEA_PASSWORD
|
||||
ARG GITEA_ACCESS_TOKEN
|
||||
ARG DIR_MODULES
|
||||
|
||||
#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 OneTeam_pos="False"
|
||||
ENV Presik="False"
|
||||
ENV Datalife="False"
|
||||
ENV NaNtic="False"
|
||||
ENV Kalenis="False"
|
||||
ENV DIR_MODULES=/usr/local/lib/$PYTHON_VERSION/dist-packages/trytond/modules
|
||||
USER root
|
||||
|
||||
RUN apt-get update \
|
||||
|
|
51
docker-compose.yml
Normal file
51
docker-compose.yml
Normal file
|
@ -0,0 +1,51 @@
|
|||
version: '3'
|
||||
services:
|
||||
db:
|
||||
image: postgres
|
||||
hostname:
|
||||
${DB_HOSTNAME}
|
||||
volumes:
|
||||
- postgres:/var/lib/postgresql/data
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
tryton:
|
||||
build:
|
||||
context: ./
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
TRYTOND_VERSION: ${TRYTOND_VERSION}
|
||||
PYTHON_VERSION: ${PYTHON_VERSION}
|
||||
OneTeam: ${OneTeam}
|
||||
GnuHealth: ${GnuHealth}
|
||||
Etrivial: ${Etrivial}
|
||||
Trytonar: ${Trytonar}
|
||||
OneTeam_pos: ${OneTeam_pos}
|
||||
Presik: ${Presik}
|
||||
Datalife: ${Datalife}
|
||||
NaNtic: ${NaNtic}
|
||||
Kalenis: ${Kalenis}
|
||||
GITEA_ORG: ${GITEA_ORG}
|
||||
GITEA_DOMAIN: ${GITEA_DOMAIN}
|
||||
GITEA_USER: ${GITEA_USER}
|
||||
GITEA_PASSWORD: ${GITEA_PASSWORD}
|
||||
GITEA_ACCESS_TOKEN: ${GITEA_ACCESS_TOKEN}
|
||||
DIR_MODULES: ${DIR_MODULES}
|
||||
ports:
|
||||
- "8000:8000"
|
||||
volumes:
|
||||
- modules:${DIR_MODULES}
|
||||
- var:/var
|
||||
depends_on:
|
||||
- db
|
||||
env_file:
|
||||
- .env
|
||||
deploy:
|
||||
resources:
|
||||
limits:
|
||||
cpus: '0.75'
|
||||
memory: 1000M
|
||||
volumes:
|
||||
modules:
|
||||
var:
|
||||
postgres:
|
|
@ -4,10 +4,10 @@ gitea_url="https://${GITEA_USER}:${GITEA_PASSWORD}@${GITEA_DOMAIN}/"
|
|||
cd /tmp
|
||||
git clone "${gitea_url}${GITEA_ORG}/oc-multi_migrate_to_gitea.git"
|
||||
multi_migrate="/tmp/oc-multi_migrate_to_gitea/migrate_to_gitea.py"
|
||||
cd $DIR_MODULES
|
||||
cd ${DIR_MODULES}
|
||||
|
||||
clone_module() {
|
||||
cd $DIR_MODULES
|
||||
cd ${DIR_MODULES}
|
||||
local org=$1
|
||||
local branch=$2
|
||||
local prefix=$3
|
||||
|
@ -43,7 +43,7 @@ clone_module() {
|
|||
}
|
||||
|
||||
inactive_module() {
|
||||
cd $DIR_MODULES
|
||||
cd ${DIR_MODULES}
|
||||
local prefix=$1
|
||||
local pip=$2
|
||||
shift
|
||||
|
@ -77,14 +77,13 @@ if [ ${OneTeam} = "True" ]; then
|
|||
&& pip3 install pytz \
|
||||
&& pip3 install numpy matplotlib \
|
||||
&& cd /opt/ \
|
||||
&& fossil clone https://sinergia:CDzmX6MhrEHA@lib.facho.cyou libfacho.fossil \
|
||||
&& fossil clone https://lib.facho.cyou libfacho.fossil --user facho \
|
||||
&& fossil open libfacho.fossil --workdir facho \
|
||||
&& cd facho \
|
||||
&& fossil checkout documento_soporte \
|
||||
&& python3 setup.py develop \
|
||||
&& python3 setup.py install \
|
||||
&& cd ${DIR_MODULES}
|
||||
|
||||
#"git+https://github.com/bit4bit/facho.git"
|
||||
prefix="trytondo-"
|
||||
team_org="OneTeam"
|
||||
pip="False"
|
||||
|
@ -94,6 +93,7 @@ if [ ${OneTeam} = "True" ]; then
|
|||
inactive_modules_trytondo=(
|
||||
sale_payment_form
|
||||
sale_pos_extras
|
||||
purchase_coffee
|
||||
)
|
||||
|
||||
inactive_module "trytond-" $pip "${inactive_modules_trytondo[@]}"
|
||||
|
|
Loading…
Reference in a new issue