Skip to content

Commit

Permalink
Add database template
Browse files Browse the repository at this point in the history
  • Loading branch information
yamelsenih committed Sep 21, 2024
1 parent 1ecc055 commit 6af1bda
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 63 deletions.
8 changes: 4 additions & 4 deletions .settings/org.eclipse.buildship.core.prefs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
arguments=
auto.sync=false
build.scans.enabled=false
connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(8.0.2))
connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
override.workspace.settings=true
show.console.view=true
show.executions.view=true
override.workspace.settings=false
show.console.view=false
show.executions.view=false
23 changes: 13 additions & 10 deletions docker-compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,33 @@ COMPOSE_PROJECT_NAME="adempiere-processor"
POSTGRES_IMAGE="postgres:13"
POSTGRES_NAME="adempiere-processor.postgres.database"
POSTGRES_PASSWORD="adempiere"
POSTGRES_PORT="5432"
POSTGRES_PORT="55432"
POSTGRES_VOLUME="adempiere-processor.volume_postgres"

# ADempiere gRPC Server
ADEMPIERE_PROCESSOR_IMAGE="openls/adempiere-processors-service:alpine-1.0.4"
ADEMPIERE_PROCESSOR_HOST="adempiere-processor.processor"
ADEMPIERE_PROCESSOR_IMAGE="openls/adempiere-processors-service:alpine-1.0.6"
ADEMPIERE_PROCESSOR_HOST="${COMPOSE_PROJECT_NAME}.adempiere-processor"

# Networks
ADEMPIERE_NETWORK="adempiere-processor.adempiere_network"


# Envoy Definition
ENVOY_NAME="adempiere-processor.grpc.proxy"
ENVOY_NAME="${COMPOSE_PROJECT_NAME}.grpc.proxy"
ENVOY_IMAGE_NAME="envoyproxy/envoy:v1.27.0"
ENVOY_VOLUME="volume_envoy"
ENVOY_PORT=5555

DKRON_IMAGE="dkron/dkron"
DKRON_HOST="adempiere-processor.dkron"
DKRON_HOST="${COMPOSE_PROJECT_NAME}.dkron"
DKRON_PORT=8080
DKRON_VOLUME="adempiere-processor.volume_dkron"

RUNDECK_IMAGE="rundeck/rundeck:4.12.0"
RUNDECK_HOST="adempiere-processor.rundeck"
RUNDECK_PORT=4440
RUNDECK_REALM_SETTING="./rundeck/realm.properties"
RUNDECK_USER_POLICIES="./rundeck/user.aclpolicy"
# Adempiere UI ZK
ADEMPIERE_ZK_IMAGE="openls/adempiere-zk-ui:jetty-1.2.0"
ADEMPIERE_ZK_HOST="${COMPOSE_PROJECT_NAME}.adempiere.zk"
ADEMPIERE_ZK_PORT=8081
ADEMPIERE_ZK_DB_HOST=${POSTGRES_NAME}
ADEMPIERE_ZK_DB_PORT=5432
ADEMPIERE_ZK_DB_NAME="adempiere"
ADEMPIERE_ZK_DB_PASSWORD=${POSTGRES_PASSWORD}
33 changes: 18 additions & 15 deletions docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ version: "3.9"

services:
adempiere.db:
build:
context: postgresql/
dockerfile: Dockerfile
container_name: ${POSTGRES_NAME}
image: ${POSTGRES_NAME}
image: ${POSTGRES_IMAGE}
restart: ${GENERIC_RESTART}
ports:
- ${POSTGRES_PORT}
- ${POSTGRES_PORT}:5432
volumes:
- volume_postgres:/var/lib/postgresql/data
- ./postgresql/initdb.sh:/docker-entrypoint-initdb.d/initdb.sh
- ./postgresql/adempiere:/tmp/adempiere
healthcheck:
test: "bash -c 'printf \"GET / HTTP/1.1\n\n\" > /dev/tcp/127.0.0.1/5432; exit $?;'"
interval: 10s
Expand Down Expand Up @@ -52,23 +51,27 @@ services:
- "--bootstrap-expect=1"
- "--node-name=node1"
- "--server"
- "--ui=false"
# - "--ui=false"
volumes:
- volume_dkron:/dkron.data
networks:
- shared_network

rundeck.scheduler:
container_name: ${RUNDECK_HOST}
image: ${RUNDECK_IMAGE}
adempiere.zk:
image: ${ADEMPIERE_ZK_IMAGE}
container_name: ${ADEMPIERE_ZK_HOST}
restart: ${GENERIC_RESTART}
ports:
- ${RUNDECK_PORT}:4440
volumes:
- ${RUNDECK_REALM_SETTING}:/home/rundeck/server/config/realm.properties
- ${RUNDECK_USER_POLICIES}:/home/rundeck/etc/user.aclpolicy
- ${ADEMPIERE_ZK_PORT}:8080
environment:
ADEMPIERE_DB_SERVER: ${ADEMPIERE_ZK_DB_HOST}
ADEMPIERE_DB_NAME: ${ADEMPIERE_ZK_DB_NAME}
ADEMPIERE_DB_PASSWORD: ${ADEMPIERE_ZK_DB_PASSWORD}
depends_on:
adempiere.db:
condition: service_healthy
networks:
- shared_network
- shared_network

grpc.proxy:
image: ${ENVOY_IMAGE_NAME}
Expand Down
8 changes: 0 additions & 8 deletions docker-compose/postgresql/Dockerfile

This file was deleted.

26 changes: 26 additions & 0 deletions docker-compose/postgresql/adempiere/after_run/001_tunning.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
ALTER SYSTEM SET
max_connections = '500';
ALTER SYSTEM SET
shared_buffers = '1GB';
ALTER SYSTEM SET
effective_cache_size = '3GB';
ALTER SYSTEM SET
maintenance_work_mem = '256MB';
ALTER SYSTEM SET
checkpoint_completion_target = '0.9';
ALTER SYSTEM SET
wal_buffers = '16MB';
ALTER SYSTEM SET
default_statistics_target = '100';
ALTER SYSTEM SET
random_page_cost = '1.1';
ALTER SYSTEM SET
effective_io_concurrency = '200';
ALTER SYSTEM SET
work_mem = '524kB';
ALTER SYSTEM SET
huge_pages = 'off';
ALTER SYSTEM SET
min_wal_size = '1GB';
ALTER SYSTEM SET
max_wal_size = '4GB';
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- connects to the adempiere database and adempiere schema
\c adempiere adempiere

UPDATE AD_System SET IsFailOnMissingModelValidator = 'N';
Binary file added docker-compose/postgresql/adempiere/seed.backup
Binary file not shown.
10 changes: 9 additions & 1 deletion docker-compose/postgresql/initdb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,13 @@ then
createuser -U postgres adempiere -dlrs
psql -U postgres -tAc "alter user adempiere password 'adempiere';"
createdb -U adempiere adempiere
psql -U adempiere -d adempiere < Adempiere_pg.dmp
pg_restore -U adempiere -d adempiere < /tmp/adempiere/seed.backup -v
fi

AFTER_RUN_DIR="/tmp/adempiere/after_run"
if [ -d "$AFTER_RUN_DIR" ]; then
find "$AFTER_RUN_DIR" -maxdepth 1 -type f -name '*.sql' -print0 | while IFS= read -r -d '' file; do
echo "importing $file"
psql -U adempiere < "$file"
done
fi
25 changes: 0 additions & 25 deletions docker-compose/rundeck/user.aclpolicy

This file was deleted.

0 comments on commit 6af1bda

Please sign in to comment.