Merge pull request #921 from bigcapitalhq/20260131-145158-fd0c
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
|
||||
|
||||
# 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/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 --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
|
||||
|
||||
@@ -2,10 +2,23 @@
|
||||
"$schema": "https://json.schemastore.org/nest-cli",
|
||||
"collection": "@nestjs/schematics",
|
||||
"sourceRoot": "src",
|
||||
"entryFile": "main",
|
||||
"compilerOptions": {
|
||||
"deleteOutDir": true,
|
||||
"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.
|
||||
BRANCH=main
|
||||
CURRENT=$PWD
|
||||
BIGCAPITAL_INSTALL_DIR=$PWD/bigcapital-$(echo $BRANCH | sed -r 's@(\/|" "|\.)@-@g')
|
||||
BIGCAPITAL_CLONE_TEMP_DIR=$(mktemp -d)
|
||||
CPU_ARCH=$(uname -m)
|
||||
|
||||
@@ -20,8 +19,6 @@ else
|
||||
COMPOSE_CMD="docker compose"
|
||||
fi
|
||||
|
||||
REPO=https://github.com/bigcapitalhq/bigcapital
|
||||
|
||||
# Prints the Bigcapital logo once running the script.
|
||||
function print_logo() {
|
||||
clear
|
||||
@@ -142,8 +139,8 @@ function askForAction() {
|
||||
}
|
||||
|
||||
function install() {
|
||||
echo "Installing Bigcaoital.........."
|
||||
echo "installing is going to take few mintues..."
|
||||
echo "Installing Bigcapital.........."
|
||||
echo "installing is going to take few minutes..."
|
||||
download
|
||||
setup_env
|
||||
}
|
||||
@@ -203,10 +200,11 @@ function startServices() {
|
||||
done
|
||||
printf "\r\033[K"
|
||||
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 ""
|
||||
echo " You can access the application at $WEB_URL"
|
||||
echo " You can access the application at $ACCESS_URL"
|
||||
echo ""
|
||||
|
||||
}
|
||||
@@ -223,20 +221,19 @@ function restartServices() {
|
||||
}
|
||||
|
||||
function viewLogs(){
|
||||
ARG_SERVICE_NAME=$2
|
||||
echo
|
||||
echo "Select a Service you want to view the logs for:"
|
||||
echo " 1) Webapp"
|
||||
echo " 2) API"
|
||||
echo " 3) Migration"
|
||||
echo " 4) Nginx Proxy"
|
||||
echo " 4) Envoy Proxy"
|
||||
echo " 5) MariaDB"
|
||||
echo " 0) Back to Main Menu"
|
||||
echo
|
||||
read -p "Service: " DOCKER_SERVICE_NAME
|
||||
|
||||
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
|
||||
done
|
||||
|
||||
@@ -248,7 +245,7 @@ function viewLogs(){
|
||||
1) viewSpecificLogs "webapp";;
|
||||
2) viewSpecificLogs "server";;
|
||||
3) viewSpecificLogs "database_migration";;
|
||||
4) viewSpecificLogs "nginx";;
|
||||
4) viewSpecificLogs "proxy";;
|
||||
5) viewSpecificLogs "mysql";;
|
||||
0) askForAction;;
|
||||
*) echo "INVALID SERVICE NAME SUPPLIED";;
|
||||
|
||||
Reference in New Issue
Block a user