Commit 2785ce71 by Ivan

feat: 挂载 bundle 产物 & 修正 cmd

parent 803cda13
...@@ -28,7 +28,7 @@ RUN apt-get update -qq && \ ...@@ -28,7 +28,7 @@ RUN apt-get update -qq && \
# Set production environment and optimize memory usage # Set production environment and optimize memory usage
ENV RAILS_ENV="production" \ ENV RAILS_ENV="production" \
BUNDLE_DEPLOYMENT="1" \ BUNDLE_DEPLOYMENT="1" \
BUNDLE_PATH="/usr/local/bundle" \ BUNDLE_PATH="/bundle" \
BUNDLE_WITHOUT="development" \ BUNDLE_WITHOUT="development" \
BUNDLE_JOBS="4" \ BUNDLE_JOBS="4" \
BUNDLE_RETRY="3" \ BUNDLE_RETRY="3" \
...@@ -48,10 +48,11 @@ RUN mkdir -p \ ...@@ -48,10 +48,11 @@ RUN mkdir -p \
/rails/log \ /rails/log \
/rails/tmp/pids \ /rails/tmp/pids \
/rails/tmp/cache \ /rails/tmp/cache \
/rails/tmp/sockets /rails/tmp/sockets \
/bundle
# Declare volumes for persistent storage # Declare volumes for persistent storage
VOLUME ["/root/.ssh", "/rails/code", "/rails/storage", "/rails/public/uploads", "/rails/public/vite", "/rails/node_modules", "/rails/log", "/rails/tmp"] VOLUME ["/root/.ssh", "/rails/code", "/rails/storage", "/rails/public/uploads", "/rails/public/vite", "/rails/node_modules", "/rails/log", "/rails/tmp", "/bundle"]
# Copy entrypoint script # Copy entrypoint script
COPY bin/docker-entrypoint /rails/bin/ COPY bin/docker-entrypoint /rails/bin/
...@@ -70,4 +71,4 @@ ENTRYPOINT ["/rails/bin/docker-entrypoint"] ...@@ -70,4 +71,4 @@ ENTRYPOINT ["/rails/bin/docker-entrypoint"]
# Start server via Thruster by default, this can be overwritten at runtime # Start server via Thruster by default, this can be overwritten at runtime
EXPOSE 80 EXPOSE 80
CMD ["./bin/thrust", "./bin/rails", "server"] CMD ["./bin/rails", "server"]
...@@ -101,6 +101,9 @@ volumes: ...@@ -101,6 +101,9 @@ volumes:
- "/root/img_manager/logs:/rails/log" - "/root/img_manager/logs:/rails/log"
# Tmp directory for pids and other temporary files # Tmp directory for pids and other temporary files
- "/root/img_manager/tmp:/rails/tmp" - "/root/img_manager/tmp:/rails/tmp"
# Bundle gems storage
- "/root/img_manager/bundle:/bundle"
# SSH keys for Git access
- "/root/.ssh:/root/.ssh" - "/root/.ssh:/root/.ssh"
...@@ -112,7 +115,7 @@ asset_path: false ...@@ -112,7 +115,7 @@ asset_path: false
# Deployment configuration for better reliability # Deployment configuration for better reliability
# Increase the time to wait for a container to become ready # Increase the time to wait for a container to become ready
# deploy_timeout: 180 deploy_timeout: 300
# # Increase the time to wait for a container to drain # # Increase the time to wait for a container to drain
# drain_timeout: 60 # drain_timeout: 60
......
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