Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
img-manager
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Lan
img-manager
Commits
803cda13
Commit
803cda13
authored
Mar 11, 2025
by
Ivan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: update entrypoint
parent
b44e4ec6
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
Dockerfile
Dockerfile
+7
-2
docker-entrypoint
bin/docker-entrypoint
+25
-1
No files found.
Dockerfile
View file @
803cda13
...
...
@@ -25,11 +25,16 @@ RUN apt-get update -qq && \
pkg-config
\
&&
rm
-rf
/var/lib/apt/lists /var/cache/apt/archives
# Set production environment
# Set production environment
and optimize memory usage
ENV
RAILS_ENV="production" \
BUNDLE_DEPLOYMENT="1" \
BUNDLE_PATH="/usr/local/bundle" \
BUNDLE_WITHOUT="development"
BUNDLE_WITHOUT="development" \
BUNDLE_JOBS="4" \
BUNDLE_RETRY="3" \
MALLOC_ARENA_MAX="2" \
LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libjemalloc.so.2" \
JEMALLOC_CONF="background_thread:true,metadata_thp:auto,dirty_decay_ms:30000,muzzy_decay_ms:30000"
# Create directories for mounted volumes
RUN
mkdir
-p
\
...
...
bin/docker-entrypoint
View file @
803cda13
...
...
@@ -213,9 +213,33 @@ if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
# Install Ruby dependencies if needed
echo
"Installing Ruby dependencies..."
echo
"Memory stats before bundle install:"
free
-h
||
echo
"free command not available"
df
-h
||
echo
"df command not available"
if
[
!
-d
"
${
BUNDLE_PATH
}
/ruby"
]
||
[
"
$FORCE_BUNDLE_INSTALL
"
=
"true"
]
;
then
bundle
install
# 尝试使用更少的并发任务和内存
echo
"Running bundle install with optimized settings..."
bundle config
set
--local
jobs
2
bundle config
set
--local
retry 3
bundle config
set
--local
without
"development test"
# 添加错误处理
if
!
bundle
install
;
then
echo
"❌ Bundle install failed!"
echo
"Trying again with more verbose output..."
bundle
install
--verbose
||
{
echo
"❌ Bundle install failed again!"
echo
"Last 100 lines of gem installation logs:"
find /usr/local/bundle/extensions
-name
"gem_make.out"
-exec
tail
-n
100
{}
\;
2>/dev/null
||
echo
"No gem_make.out files found"
exit
1
}
fi
echo
"✅ Ruby dependencies installed"
echo
"Memory stats after bundle install:"
free
-h
||
echo
"free command not available"
df
-h
||
echo
"df command not available"
else
echo
"✅ Ruby dependencies already installed"
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment