Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ services:
# "Binding to IPv6" for details.
# - "[::]:${PORT:-3000}:3000"
restart: unless-stopped
# Inject any variables you set in .env (ONBOARDING_STATE, APP_DOMAIN,
# SMTP_*, etc.). The explicit `environment` values below take precedence
# over .env, so container-critical settings (DB_HOST, REDIS_URL, ...) stay
# correct. `required: false` keeps this working when no .env file exists.
env_file:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep .env from overriding the fixed container port

When a self-hoster changes the documented PORT value in .env, this env_file also injects that value into web, so Puma listens on it (config/puma.rb:44) while Compose still publishes ${PORT}:3000 (compose.example.yml:72). For example, PORT=3001 maps host port 3001 to an unused container port 3000, making the UI unreachable. The Compose short port syntax is [HOST:]CONTAINER[/PROTOCOL]; pin PORT: 3000 in the explicit container environment or change the container-side mapping accordingly.

Useful? React with 👍 / 👎.

- path: .env

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve defaults for blank entries in the sample environment

When users follow docs/hosting/docker.md:61-96 and leave optional entries from .env.example untouched, this imports values such as PRODUCT_NAME=, BRAND_NAME=, and EMAIL_SENDER= as empty strings rather than leaving them unset; the Compose env_file syntax specifies that VAR= becomes an empty string. Consequently, the ENV.fetch defaults in config/initializers/brand.rb:2-3 and app/mailers/application_mailer.rb:3 are bypassed, producing blank product branding and potentially a blank default sender. Comment out optional blank entries in the distributed sample or normalize them before relying on ENV.fetch defaults.

Useful? React with 👍 / 👎.

required: false
environment:
<<: *rails_env
# BINDING: "::" # Uncomment for IPv6 dual-stack inside the container
Expand All @@ -95,6 +102,10 @@ services:
volumes:
- app-storage:/rails/storage
restart: unless-stopped
# Same as `web`: pass through .env while keeping explicit values authoritative.
env_file:
- path: .env
required: false
depends_on:
db:
condition: service_healthy
Expand Down
Loading