This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c0d0744
commit 69b60bb
Showing
4 changed files
with
189 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
FROM registry.digitalocean.com/erpya/adempiere-cloud:latest as libs | ||
FROM gradle:7.4.1 as bridge | ||
ARG BUILD_ARTIFACT | ||
|
||
COPY --from=libs /opt/Adempiere/jboss/server/adempiere/deploy/adempiere.ear/ /opt/libDeploy/ | ||
|
||
LABEL maintainer="[email protected]; [email protected]" \ | ||
description="ADempiere gRPC All In One Server used as ADempiere backend" | ||
|
||
# Init ENV with default values | ||
ENV \ | ||
SERVER_PORT="50059" \ | ||
SERVICES_ENABLED="access; business; core; dashboarding; dictionary; enrollment; log; ui; workflow; store; pos;" \ | ||
SERVER_LOG_LEVEL="WARNING" \ | ||
DB_HOST="localhost" \ | ||
DB_PORT="5432" \ | ||
DB_NAME="adempiere" \ | ||
DB_USER="adempiere" \ | ||
DB_PASSWORD="adempiere" \ | ||
DB_TYPE="PostgreSQL" \ | ||
BUILD_ARTIFACT=$BUILD_ARTIFACT | ||
|
||
|
||
|
||
EXPOSE ${SERVER_PORT} | ||
|
||
COPY $BUILD_ARTIFACT /opt/Apps/source | ||
|
||
RUN cd /opt/libDeploy && \ | ||
unzip -o adempiereRoot.war && \ | ||
unzip adempiereHome/AdempiereClient.zip && \ | ||
mkdir /opt/Apps/source/dependences && \ | ||
mv Adempiere/lib/ext/*.jar /opt/Apps/source/dependences/ && \ | ||
mv Adempiere.jar /opt/Apps/source/dependences/ && \ | ||
mv AdempiereSLib.jar /opt/Apps/source/dependences/ && \ | ||
rm /opt/Apps/source/dependences/adempiere-gRPC-Server.jar && \ | ||
rm -R /opt/libDeploy && \ | ||
cd /opt/Apps/source && \ | ||
gradle build && \ | ||
unzip -d /opt/Apps /opt/Apps/source/build/distributions/adempiere-customer-backend.zip && \ | ||
mv /opt/Apps/adempiere-customer-backend /opt/Apps/ADempiere-gRPC-Server && \ | ||
cp /opt/Apps/source/build-docker/all_in_one_connection.yaml /opt/Apps/ADempiere-gRPC-Server/bin/ && \ | ||
cp /opt/Apps/source/build-docker/start.sh /opt/Apps/ADempiere-gRPC-Server/bin/ && \ | ||
cp /opt/Apps/source/build-docker/all_in_one_connection.yaml /opt/Apps/ADempiere-gRPC-Server/bin/ | ||
|
||
FROM openjdk:8-jdk-alpine | ||
|
||
# timezone | ||
ENV TZ America/Caracas | ||
|
||
# Add operative system dependencies | ||
RUN rm -rf /var/cache/apk/* && \ | ||
rm -rf /tmp/* && \ | ||
apk update && \ | ||
apk add --no-cache \ | ||
bash \ | ||
fontconfig \ | ||
ttf-dejavu && \ | ||
echo "Set Timezone..." && \ | ||
echo $TZ > /etc/timezone && \ | ||
apk add --no-cache \ | ||
tzdata | ||
|
||
COPY --from=bridge /opt/Apps/ADempiere-gRPC-Server /opt/Apps/ADempiere-gRPC-Server | ||
|
||
WORKDIR /opt/Apps/ADempiere-gRPC-Server/bin/ | ||
|
||
|
||
# Start app | ||
CMD 'sh' 'start.sh' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
server: | ||
port: 50059 | ||
host: localhost | ||
log_level: WARNING | ||
adempiere_token: adempiere_token_value | ||
database: | ||
host: localhost | ||
port: 5432 | ||
name: adempiere_database_value | ||
user: adempiere_user_value | ||
password: adempiere_pass_value | ||
type: PostgreSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/usr/bin/env sh | ||
# @autor Yamel Senih <[email protected]> | ||
|
||
# Set server values | ||
sed -i "s|50059|$SERVER_PORT|g" env.yaml | ||
sed -i "s|WARNING|$SERVER_LOG_LEVEL|g" env.yaml | ||
|
||
|
||
# create array to iterate | ||
SERVICES_LIST=$(echo $SERVICES_ENABLED | tr "; " "\n") | ||
|
||
SERVICES_LIST_TO_SET="" | ||
for SERVICE_ITEM in $SERVICES_LIST | ||
do | ||
# Service to lower case | ||
SERVICE_LOWER_CASE=$(echo $SERVICE_ITEM | tr '[:upper:]' '[:lower:]') | ||
|
||
NEW_LINE="\n" | ||
PREFIX=" - " | ||
if [ -z "$SERVICES_LIST_TO_SET" ] | ||
then | ||
NEW_LINE="" | ||
PREFIX="- " | ||
fi | ||
|
||
# Add to the list of services | ||
SERVICES_LIST_TO_SET="${SERVICES_LIST_TO_SET}${NEW_LINE}${PREFIX}${SERVICE_LOWER_CASE}" | ||
done | ||
|
||
sed -i "s|- services_enabled|$SERVICES_LIST_TO_SET|g" env.yaml | ||
|
||
export DEFAULT_JAVA_OPTIONS='"-Xms64M" "-Xmx1512M"' | ||
# Set data base conection values | ||
sed -i "s|localhost|$DB_HOST|g" env.yaml | ||
sed -i "s|5432|$DB_PORT|g" env.yaml | ||
sed -i "s|adempieredb|$DB_NAME|g" env.yaml | ||
sed -i "s|adempiereuser|$DB_USER|g" env.yaml | ||
sed -i "s|adempierepass|$DB_PASSWORD|g" env.yaml | ||
sed -i "s|PostgreSQL|$DB_TYPE|g" env.yaml | ||
sed -i "s|PostgreSQL|$DB_TYPE|g" env.yaml | ||
sed -i "s|$DEFAULT_JAVA_OPTIONS|$GRPC_JAVA_OPTIONS|g" adempiere-middleware-server | ||
|
||
|
||
# Run app | ||
./adempiere-middleware-server ./env.yaml |