Commit b44e4ec6 by Ivan

feat: update entrypoint

parent 93a73348
......@@ -14,5 +14,9 @@
# Replace 'your-docker-password' with your actual Docker Hub password
KAMAL_REGISTRY_PASSWORD=$(cat registry_password.key)
# Git credentials for private repositories
# 这里使用SSH私钥的内容作为GIT_CREDENTIALS
GIT_CREDENTIALS=$(cat ~/.ssh/id_rsa)
# Improve security by using a password manager. Never check config/master.key into git!
RAILS_MASTER_KEY=$(cat config/master.key)
......@@ -193,9 +193,12 @@ for dir in app bin config db lib public vendor; do
done
# Link important files
for file in Gemfile Gemfile.lock Rakefile config.ru; do
for file in Gemfile Gemfile.lock Rakefile config.ru package.json package-lock.json; do
if [ -f "/rails/code/$file" ]; then
ln -sf /rails/code/$file /rails/$file
echo "Linked $file"
else
echo "Warning: $file not found in /rails/code"
fi
done
......@@ -218,13 +221,18 @@ if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
fi
# Install Node.js dependencies if needed
echo "Installing Node.js dependencies..."
echo "Checking for package.json..."
if [ -f "/rails/package.json" ]; then
echo "Found package.json, installing Node.js dependencies..."
if [ ! -d "/rails/node_modules/node_modules" ] || [ "$FORCE_NPM_INSTALL" = "true" ]; then
npm install
echo "✅ Node.js dependencies installed"
else
echo "✅ Node.js dependencies already installed"
fi
else
echo "No package.json found in /rails, skipping npm install"
fi
# Prepare database files with proper permissions
echo "Ensuring database files exist with proper permissions..."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment