first commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
# Environment Variables
|
||||||
|
BASIC_AUTH_USERNAME=user
|
||||||
|
BASIC_AUTH_PASSWORD=password
|
||||||
|
SWAGGER_URL="/documentation"
|
||||||
|
API_URL="/swagger.json"
|
||||||
|
|
||||||
|
|
||||||
|
SWAGGER_URL="/documentation"
|
||||||
|
API_URL="/swagger.json"
|
||||||
|
|
||||||
|
DATABASE_USER=firstadvance
|
||||||
|
DATABASE_PASSWORD=FirstAdvance!
|
||||||
|
DATABASE_HOST=dev-data.simbrellang.net
|
||||||
|
DATABASE_PORT=10532
|
||||||
|
DATABASE_NAME=firstadvancedev
|
||||||
|
|
||||||
|
KAFKA_BROKER = 'WHAT_IS_IP_KAFKA:9085'
|
||||||
|
|
||||||
|
# Flask Configuration
|
||||||
|
FLASK_APP=wsgi.py
|
||||||
|
FLASK_ENV=development
|
||||||
|
APP_PORT=4500
|
||||||
|
|
||||||
|
|
||||||
|
SIMBRELLA_BASE_URL="https://bank-emulator.dev.simbrellang.net"
|
||||||
|
SIMBRELLA_APP_ID="app1"
|
||||||
|
SIMBRELLA_API_KEY="testtest-api-key-12345"
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
|
||||||
|
APP_PORT=5000
|
||||||
|
|
||||||
|
KAFKA_TIMEOUT=1000.0
|
||||||
|
KAFKA_BROKER="10.20.30.50:9092"
|
||||||
|
KAFKA_TOPICS="PROCESS_PAYMENT,LOAN_REPAYMENT"
|
||||||
|
|
||||||
|
|
||||||
|
DATABASE_USER=firstadvance
|
||||||
|
DATABASE_PASSWORD=FirstAdvance!
|
||||||
|
DATABASE_HOST=10.20.30.60
|
||||||
|
DATABASE_PORT=5432
|
||||||
|
DATABASE_NAME=firstadvancedev
|
||||||
|
|
||||||
|
BANK_CALL_APP_ID="app1"
|
||||||
|
BANK_CALL_API_KEY="testtest-api-key-12345"
|
||||||
|
|
||||||
|
|
||||||
|
BANK_CALL_DISBURSE_LOAN_ENDPOINT="/api/DisburseLoan"
|
||||||
|
BANK_CALL_COLLECT_LOAN_ENDPOINT="/api/CollectLoan"
|
||||||
|
BANK_CALL_TRANSACTION_VERIFY="/api/TransactionVerify"
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
services:
|
||||||
|
digifi-core:
|
||||||
|
image: "image: registry.simbrellang.net/digifi/banktoproductcore:latest"
|
||||||
|
build: .
|
||||||
|
env_file:
|
||||||
|
- .env.core
|
||||||
|
ports:
|
||||||
|
- "${APP_PORT:-4500}:5000"
|
||||||
|
environment:
|
||||||
|
- FLASK_APP=${FLASK_APP}
|
||||||
|
- FLASK_ENV=${FLASK_ENV}
|
||||||
|
- DATABASE_URL=postgresql+psycopg2://${DATABASE_USER}:${DATABASE_PASSWORD}@${DATABASE_HOST}:${DATABASE_PORT}/${DATABASE_NAME}
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
digifi-event:
|
||||||
|
image: "image: registry.simbrellang.net/digifi/eventmanager:latest"
|
||||||
|
build: .
|
||||||
|
env_file:
|
||||||
|
- .env.event
|
||||||
|
ports:
|
||||||
|
- "${APP_PORT:-5000}:5000"
|
||||||
|
environment:
|
||||||
|
- FLASK_APP=${FLASK_APP}
|
||||||
|
- FLASK_ENV=${FLASK_ENV}
|
||||||
|
volumes:
|
||||||
|
- .:/app
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
|
||||||
+52
@@ -0,0 +1,52 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
log() {
|
||||||
|
local message="$1"
|
||||||
|
echo -e "\033[32mLog: $message\033[0m"
|
||||||
|
}
|
||||||
|
|
||||||
|
handle_error() {
|
||||||
|
local error_message="$1"
|
||||||
|
echo -e "\033[31mError: $error_message\033[0m"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
retry() {
|
||||||
|
local max_attempts=5
|
||||||
|
local attempt=1
|
||||||
|
local delay=1
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
"$@" && break || {
|
||||||
|
if [ $attempt -lt $max_attempts ]; then
|
||||||
|
log "Command failed (attempt $attempt/$max_attempts). Retrying in $delay seconds..."
|
||||||
|
sleep $delay
|
||||||
|
delay=$((delay * 2))
|
||||||
|
((attempt++))
|
||||||
|
else
|
||||||
|
handle_error "Command failed after $attempt attempts: $*"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# MAIN
|
||||||
|
################################################################################
|
||||||
|
if [ "$1" == "product" ]; then
|
||||||
|
start_services
|
||||||
|
cd ../product || handle_error "Failed to enter 'product' directory"
|
||||||
|
log "Start client in dev mode"
|
||||||
|
retry docker compose up -d --build
|
||||||
|
|
||||||
|
elif [ "$1" == "helper" ]; then
|
||||||
|
start_services
|
||||||
|
cd ../client || handle_error "Failed to enter 'client' directory"
|
||||||
|
log "Start client in test mode"
|
||||||
|
npm run start:static
|
||||||
|
|
||||||
|
else
|
||||||
|
handle_error "Invalid argument. Use 'dev' or 'test'."
|
||||||
|
fi
|
||||||
|
|
||||||
Reference in New Issue
Block a user