Skip to content

Environment variables from .env do not seem to be passed #2773

Description

@Elu43

Hello

I am using the provided Docker Compose configuration for Sure.

I added the documented environment variables to my .env file, including:

SELF_HOSTED=true
ONBOARDING_STATE=closed
APP_DOMAIN=sure.example.com
SMTP_ADDRESS=mail.example.com
SMTP_PORT=587
SMTP_USERNAME=user@example.com
SMTP_PASSWORD=example-password
SMTP_TLS_ENABLED=true
EMAIL_SENDER=no-reply@example.com

However, onboarding still appears to be open and I can still access the account creation flow. Emails don't work.

When I run printenv inside the web container, I can see variables that are explicitly declared in the Compose environment: block, such as:

SELF_HOSTED=true
DB_HOST=db
REDIS_URL=redis://redis:6379/1

But I do not see:

ONBOARDING_STATE
APP_DOMAIN
etc.

The provided Compose file uses an environment anchor such as:

x-rails-env: &rails-env
SELF_HOSTED: "true"
DB_HOST: db
REDIS_URL: redis://redis:6379/1

services:
web:
environment:
<<: *rails-env

worker:
environment:
<<: *rails-env

It does not use:

env_file:

  • .env

Should users add env_file: .env to both the web and worker services?

Should every supported variable be explicitly added to x-rails-env?

Thanks for clarifying the expected Docker Compose configuration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions