fix(scripts): db migration dockerfile
This commit is contained in:
@@ -35,4 +35,4 @@ WORKDIR /app/packages/server
|
|||||||
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
RUN git clone https://github.com/vishnubob/wait-for-it.git
|
||||||
|
|
||||||
# Once we listen the mysql port run the migration task.
|
# Once we listen the mysql port run the migration task.
|
||||||
CMD ./wait-for-it/wait-for-it.sh mysql:3306 -- sh -c "pnpm run system:migrate:latest && pnpm run tenants:migrate:latest"
|
CMD ./wait-for-it/wait-for-it.sh mysql:3306 -- sh -c "node dist/cli.js system:migrate:latest && node dist/cli.js tenants:migrate:latest"
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ COPY --from=builder --chown=nodejs:nodejs /app/packages/server/src/i18n ./packag
|
|||||||
COPY --from=builder --chown=nodejs:nodejs /app/packages/server/public ./packages/server/public
|
COPY --from=builder --chown=nodejs:nodejs /app/packages/server/public ./packages/server/public
|
||||||
COPY --from=builder --chown=nodejs:nodejs /app/packages/server/static ./packages/server/static
|
COPY --from=builder --chown=nodejs:nodejs /app/packages/server/static ./packages/server/static
|
||||||
|
|
||||||
|
# Copy database migration files (needed for running migrations)
|
||||||
|
COPY --from=builder --chown=nodejs:nodejs /app/packages/server/src/database ./packages/server/src/database
|
||||||
|
|
||||||
# Copy built shared packages (dist folders and package.json for module resolution)
|
# Copy built shared packages (dist folders and package.json for module resolution)
|
||||||
COPY --from=builder --chown=nodejs:nodejs /app/shared/bigcapital-utils/dist ./shared/bigcapital-utils/dist
|
COPY --from=builder --chown=nodejs:nodejs /app/shared/bigcapital-utils/dist ./shared/bigcapital-utils/dist
|
||||||
COPY --from=builder --chown=nodejs:nodejs /app/shared/pdf-templates/dist ./shared/pdf-templates/dist
|
COPY --from=builder --chown=nodejs:nodejs /app/shared/pdf-templates/dist ./shared/pdf-templates/dist
|
||||||
|
|||||||
@@ -2,10 +2,23 @@
|
|||||||
"$schema": "https://json.schemastore.org/nest-cli",
|
"$schema": "https://json.schemastore.org/nest-cli",
|
||||||
"collection": "@nestjs/schematics",
|
"collection": "@nestjs/schematics",
|
||||||
"sourceRoot": "src",
|
"sourceRoot": "src",
|
||||||
|
"entryFile": "main",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"deleteOutDir": true,
|
"deleteOutDir": true,
|
||||||
"assets": [
|
"assets": [
|
||||||
{ "include": "i18n/**/*", "watchAssets": true }
|
{ "include": "i18n/**/*", "watchAssets": true },
|
||||||
|
{ "include": "database/**/*", "watchAssets": true }
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"projects": {
|
||||||
|
"cli": {
|
||||||
|
"type": "application",
|
||||||
|
"root": "src",
|
||||||
|
"entryFile": "cli",
|
||||||
|
"sourceRoot": "src",
|
||||||
|
"compilerOptions": {
|
||||||
|
"tsConfigPath": "tsconfig.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
19
setup.sh
19
setup.sh
@@ -2,7 +2,6 @@
|
|||||||
# Initialize the essential variables.
|
# Initialize the essential variables.
|
||||||
BRANCH=main
|
BRANCH=main
|
||||||
CURRENT=$PWD
|
CURRENT=$PWD
|
||||||
BIGCAPITAL_INSTALL_DIR=$PWD/bigcapital-$(echo $BRANCH | sed -r 's@(\/|" "|\.)@-@g')
|
|
||||||
BIGCAPITAL_CLONE_TEMP_DIR=$(mktemp -d)
|
BIGCAPITAL_CLONE_TEMP_DIR=$(mktemp -d)
|
||||||
CPU_ARCH=$(uname -m)
|
CPU_ARCH=$(uname -m)
|
||||||
|
|
||||||
@@ -20,8 +19,6 @@ else
|
|||||||
COMPOSE_CMD="docker compose"
|
COMPOSE_CMD="docker compose"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
REPO=https://github.com/bigcapitalhq/bigcapital
|
|
||||||
|
|
||||||
# Prints the Bigcapital logo once running the script.
|
# Prints the Bigcapital logo once running the script.
|
||||||
function print_logo() {
|
function print_logo() {
|
||||||
clear
|
clear
|
||||||
@@ -142,8 +139,8 @@ function askForAction() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function install() {
|
function install() {
|
||||||
echo "Installing Bigcaoital.........."
|
echo "Installing Bigcapital.........."
|
||||||
echo "installing is going to take few mintues..."
|
echo "installing is going to take few minutes..."
|
||||||
download
|
download
|
||||||
setup_env
|
setup_env
|
||||||
}
|
}
|
||||||
@@ -203,10 +200,11 @@ function startServices() {
|
|||||||
done
|
done
|
||||||
printf "\r\033[K"
|
printf "\r\033[K"
|
||||||
echo " API server started successfully ✅"
|
echo " API server started successfully ✅"
|
||||||
source "${DOCKER_ENV_PATH}"
|
ACCESS_URL=$(grep -E '^BASE_URL=' "$DOCKER_ENV_PATH" 2>/dev/null | cut -d= -f2-)
|
||||||
|
[ -z "$ACCESS_URL" ] && ACCESS_URL="http://localhost"
|
||||||
echo " Bigcapital server started successfully ✅"
|
echo " Bigcapital server started successfully ✅"
|
||||||
echo ""
|
echo ""
|
||||||
echo " You can access the application at $WEB_URL"
|
echo " You can access the application at $ACCESS_URL"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -223,20 +221,19 @@ function restartServices() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function viewLogs(){
|
function viewLogs(){
|
||||||
ARG_SERVICE_NAME=$2
|
|
||||||
echo
|
echo
|
||||||
echo "Select a Service you want to view the logs for:"
|
echo "Select a Service you want to view the logs for:"
|
||||||
echo " 1) Webapp"
|
echo " 1) Webapp"
|
||||||
echo " 2) API"
|
echo " 2) API"
|
||||||
echo " 3) Migration"
|
echo " 3) Migration"
|
||||||
echo " 4) Nginx Proxy"
|
echo " 4) Envoy Proxy"
|
||||||
echo " 5) MariaDB"
|
echo " 5) MariaDB"
|
||||||
echo " 0) Back to Main Menu"
|
echo " 0) Back to Main Menu"
|
||||||
echo
|
echo
|
||||||
read -p "Service: " DOCKER_SERVICE_NAME
|
read -p "Service: " DOCKER_SERVICE_NAME
|
||||||
|
|
||||||
until (( DOCKER_SERVICE_NAME >= 0 && DOCKER_SERVICE_NAME <= 5 )); do
|
until (( DOCKER_SERVICE_NAME >= 0 && DOCKER_SERVICE_NAME <= 5 )); do
|
||||||
echo "Invalid selection. Please enter a number between 1 and 11."
|
echo "Invalid selection. Please enter a number between 0 and 5."
|
||||||
read -p "Service: " DOCKER_SERVICE_NAME
|
read -p "Service: " DOCKER_SERVICE_NAME
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -248,7 +245,7 @@ function viewLogs(){
|
|||||||
1) viewSpecificLogs "webapp";;
|
1) viewSpecificLogs "webapp";;
|
||||||
2) viewSpecificLogs "server";;
|
2) viewSpecificLogs "server";;
|
||||||
3) viewSpecificLogs "database_migration";;
|
3) viewSpecificLogs "database_migration";;
|
||||||
4) viewSpecificLogs "nginx";;
|
4) viewSpecificLogs "proxy";;
|
||||||
5) viewSpecificLogs "mysql";;
|
5) viewSpecificLogs "mysql";;
|
||||||
0) askForAction;;
|
0) askForAction;;
|
||||||
*) echo "INVALID SERVICE NAME SUPPLIED";;
|
*) echo "INVALID SERVICE NAME SUPPLIED";;
|
||||||
|
|||||||
Reference in New Issue
Block a user