Remove lograge configuration from Docker image and production
This commit is contained in:
parent
4948fe50e3
commit
fdf3289f54
2 changed files with 6 additions and 17 deletions
14
Dockerfile
14
Dockerfile
|
|
@ -8,7 +8,7 @@ ARG BUN_VERSION=1.3.9
|
||||||
|
|
||||||
# --- Stage 1: Grab Node.js Binaries ---
|
# --- Stage 1: Grab Node.js Binaries ---
|
||||||
# We use the official image as a source for pre-compiled binaries
|
# We use the official image as a source for pre-compiled binaries
|
||||||
FROM docker.io/library/node:${NODE_VERSION}-slim AS node_source
|
FROM docker.io/library/node:${NODE_VERSION} AS node_source
|
||||||
|
|
||||||
# --- Stage 2: Base (Runtime Environment) ---
|
# --- Stage 2: Base (Runtime Environment) ---
|
||||||
FROM docker.io/library/ruby:${RUBY_VERSION}-slim AS base
|
FROM docker.io/library/ruby:${RUBY_VERSION}-slim AS base
|
||||||
|
|
@ -36,15 +36,13 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
|
||||||
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
--mount=type=cache,target=/var/lib/apt,sharing=locked \
|
||||||
apt-get update -qq && \
|
apt-get update -qq && \
|
||||||
apt-get install --no-install-recommends -y \
|
apt-get install --no-install-recommends -y \
|
||||||
build-essential git libyaml-dev node-gyp pkg-config python-is-python3
|
build-essential git libyaml-dev pkg-config python-is-python3
|
||||||
|
|
||||||
# "Heist" Node.js and npm from the node_source stage (build-time only)
|
# Install Node.js and npm from node_source
|
||||||
COPY --from=node_source /usr/local/bin/node /usr/local/bin/node
|
COPY --from=node_source /usr/local/ /usr/local/
|
||||||
COPY --from=node_source /usr/local/lib/node_modules /usr/local/lib/node_modules
|
|
||||||
|
|
||||||
# Re-link npm and install Bun (build-time only)
|
# Install Bun
|
||||||
RUN ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm && \
|
RUN npm install -g bun@${BUN_VERSION}
|
||||||
npm install -g bun@${BUN_VERSION}
|
|
||||||
|
|
||||||
# 1. Install Gems (Separate COPY for maximum caching)
|
# 1. Install Gems (Separate COPY for maximum caching)
|
||||||
COPY Gemfile Gemfile.lock ./
|
COPY Gemfile Gemfile.lock ./
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,6 @@ Rails.application.configure do
|
||||||
config.log_tags = [:request_id]
|
config.log_tags = [:request_id]
|
||||||
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
|
config.logger = ActiveSupport::TaggedLogging.logger(STDOUT)
|
||||||
|
|
||||||
# Lograge - structured request logging
|
|
||||||
config.lograge.enabled = true
|
|
||||||
config.lograge.custom_options = lambda do |event|
|
|
||||||
{
|
|
||||||
request_id: event.payload[:request_id],
|
|
||||||
user_id: event.payload[:user_id]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Change to "debug" to log everything (including potentially personally-identifiable information!).
|
# Change to "debug" to log everything (including potentially personally-identifiable information!).
|
||||||
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
|
config.log_level = ENV.fetch('RAILS_LOG_LEVEL', 'info')
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue