-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adempiere-docker#12 Restructure the deployment of dockers containers #12
- Loading branch information
1 parent
2202953
commit 6fa13ad
Showing
8 changed files
with
290 additions
and
127 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
# Copyright (C) 2010-2017, OpenUp S.A. , http://www.openup.com.uy | ||
# Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as published by | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# You should have received a copy of the GNU Affero General Public License | ||
# GNU General Public License for more details. | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# Email: [email protected], http://openupsolutions.com , http://github.com/rcapecce | ||
# Email: [email protected], http://www.e-evolution.com , http://github.com/e-Evolution | ||
# | ||
|
||
ADEMPIERE_VERSION=390LTS | ||
ADEMPIERE_TENANT=tenant1 | ||
ADEMPIERE_DB_PORT=55432 | ||
COMPOSE_PROJECT_NAME=eevolution | ||
ADEMPIERE_WEB_PORT=8277 | ||
ADEMPIERE_SSL_PORT=4445 | ||
ADEMPIERE_DB_SERVER=10.10.1.122 | ||
ADEMPIERE_APPS_SERVER= | ||
ADEMPIERE_DB_USER=usertenant1 | ||
ADEMPIERE_SSL_PORT=4444 | ||
ADEMPIERE_DB_PORT=55432 | ||
ADEMPIERE_VERSION=3.9.0 | ||
ADEMPIERE_DB_PASSWORD=adempiere | ||
ADEMPIERE_DB_ADMIN_PASSWORD=postgres | ||
|
||
# ATENTION If is "Y" it will be replace de actual defined database with a empty ADempiere seed | ||
ADEMPIERE_DB_INIT=Y |
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 |
---|---|---|
@@ -1,8 +1,7 @@ | ||
FROM openjdk:8-jdk | ||
MAINTAINER [email protected] | ||
MAINTAINER [email protected] , [email protected] | ||
|
||
|
||
ARG ADEMPIERE_REL | ||
ARG ADEMPIERE_BINARY | ||
ARG ADEMPIERE_SRC_DIR | ||
ARG ADEMPIERE_DB_HOST | ||
ARG ADEMPIERE_DB_PORT | ||
|
@@ -12,7 +11,7 @@ ARG ADEMPIERE_DB_PASSWORD | |
ARG ADEMPIERE_DB_ADMIN_PASSWORD | ||
ARG ADEMPIERE_WEB_PORT | ||
|
||
ENV ADEMPIERE_REL $ADEMPIERE_REL | ||
ENV ADEMPIERE_BINARY $ADEMPIERE_BINARY | ||
ENV ADEMPIERE_SRC_DIR $ADEMPIERE_SRC_DIR | ||
ENV ADEMPIERE_DB_HOST $ADEMPIERE_DB_HOST | ||
ENV ADEMPIERE_DB_PORT $ADEMPIERE_DB_PORT | ||
|
@@ -25,14 +24,14 @@ ENV ADEMPIERE_WEB_PORT $ADEMPIERE_WEB_PORT | |
ENV ADEMPIERE_HOME /opt/Adempiere | ||
ENV AD_DB_Init $AD_DB_Init | ||
|
||
COPY $ADEMPIERE_SRC_DIR/Adempiere_$ADEMPIERE_REL.tar.gz /tmp | ||
COPY $ADEMPIERE_SRC_DIR/$ADEMPIERE_BINARY /tmp | ||
COPY $ADEMPIERE_SRC_DIR/lib /tmp/lib | ||
COPY $ADEMPIERE_SRC_DIR/packages /tmp/packages | ||
COPY ./adempiere-last/start-adempiere.sh /root | ||
COPY ./adempiere-last/define-ad-ctl.sh /root | ||
|
||
RUN cd /tmp && \ | ||
tar zxvf /tmp/Adempiere_$ADEMPIERE_REL.tar.gz && \ | ||
tar zxvf /tmp/$ADEMPIERE_BINARY && \ | ||
mv Adempiere /opt/Adempiere && \ | ||
mv lib /opt/Adempiere/lib && \ | ||
mv packages /opt/Adempiere/packages && \ | ||
|
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 @@ | ||
# Copyright (C) 2010-2017, OpenUp S.A. , http://www.openup.com.uy | ||
# Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# Email: [email protected], http://openupsolutions.com , http://github.com/rcapecce | ||
# Email: [email protected], http://www.e-evolution.com , http://github.com/e-Evolution | ||
# | ||
|
||
version: '3' | ||
services: | ||
adempiere-tenant: | ||
networks: | ||
- custom | ||
external_links: | ||
- database:database | ||
image: "${COMPOSE_PROJECT_NAME}" # Name of the instance for docker create based on project name | ||
container_name: "${COMPOSE_PROJECT_NAME}" # Name of the ADempiere client container | ||
ports: | ||
- ${ADEMPIERE_WEB_PORT}:8888 # http port where the web client will be exposed | ||
- ${ADEMPIERE_SSL_PORT}:444 # https port where the web client will be exposed | ||
environment: | ||
ADEMPIERE_DB_INIT: ${ADEMPIERE_DB_INIT} # ATENTION If is "Y" it will be replace de actual defined database with a empty ADempiere seed | ||
build: | ||
context: . | ||
dockerfile: ./adempiere-last/Dockerfile | ||
args: | ||
ADEMPIERE_BINARY : ${ADEMPIERE_BINARY} | ||
ADEMPIERE_SRC_DIR: "./${COMPOSE_PROJECT_NAME}" # Directory that contain the ADempiere installer, customization and localization | ||
ADEMPIERE_DB_HOST: "database" | ||
ADEMPIERE_DB_PORT: 5432 | ||
ADEMPIERE_DB_NAME: "${COMPOSE_PROJECT_NAME}" | ||
ADEMPIERE_DB_USER: "${COMPOSE_PROJECT_NAME}" | ||
ADEMPIERE_DB_PASSWORD: ${ADEMPIERE_DB_PASSWORD} | ||
ADEMPIERE_DB_ADMIN_PASSWORD: ${ADEMPIERE_DB_ADMIN_PASSWORD} | ||
networks: | ||
custom: | ||
external: true |
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 @@ | ||
# Copyright (C) 2003-2017, e-Evolution Consultants S.A. , http://www.e-evolution.com | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# Email: [email protected], http://www.e-evolution.com , http://github.com/e-Evolution | ||
|
||
#!/usr/bin/env bash | ||
BASE_DIR=$(cd "$(dirname "$0")"; pwd) | ||
# load environment variables | ||
. .env | ||
|
||
if [ $(docker network inspect -f '{{.Name}}' custom) != "custom" ]; | ||
then | ||
echo "Create custom network" | ||
docker network create -d bridge custom | ||
fi | ||
|
||
if [ $(docker inspect -f '{{.State.Running}}' postgres96_database_1) = "true" ]; | ||
then | ||
echo "Database container is running" | ||
else | ||
echo "Create Database container" | ||
docker-compose \ | ||
-f "$BASE_DIR/database.yml" \ | ||
-f "$BASE_DIR/database.volume.yml" \ | ||
"$@" \ | ||
-p postgres96_database_1 | ||
fi | ||
|
||
# Define Adempiere path and binary | ||
ADEMPIERE_PATH="./$COMPOSE_PROJECT_NAME" | ||
ADEMPIERE_BINARY=Adempiere_${ADEMPIERE_VERSION//.}"LTS.tar.gz" | ||
export ADEMPIERE_BINARY; | ||
URL="https://github.com/adempiere/adempiere/releases/download/"$ADEMPIERE_VERSION"/"$ADEMPIERE_BINARY | ||
|
||
echo "Adempiere Path $ADEMPIERE_PATH" | ||
echo "Adempiere Version $ADEMPIERE_VERSION" | ||
echo "Adempiere Binary $ADEMPIERE_PATH/$ADEMPIERE_BINARY" | ||
echo "Download from $URL" | ||
|
||
|
||
if [ -d "$ADEMPIERE_PATH" ] | ||
then | ||
if [ -f "$ADEMPIERE_PATH/$ADEMPIERE_BINARY" ] | ||
then | ||
echo "Installed based on $ADEMPIERE_PATH/$ADEMPIERE_BINARY" | ||
else | ||
curl -L $URL > "$ADEMPIERE_PATH/$ADEMPIERE_BINARY" | ||
if [ -f "$ADEMPIERE_PATH/$ADEMPIERE_BINARY" ] | ||
then | ||
echo "Adempiere Binary download successful" | ||
else | ||
"Adempiere Binary not download" | ||
exit | ||
fi | ||
fi | ||
# Execute docker-compose | ||
docker-compose \ | ||
-f "$BASE_DIR/adempiere.yml" \ | ||
"$@" | ||
else | ||
echo "Project directory not found for : $COMPOSE_PROJECT_NAME " | ||
fi |
Oops, something went wrong.