Skip to content

Conversation

@sonarta
Copy link
Contributor

@sonarta sonarta commented Sep 8, 2025

Summary

This PR fixes the Docker Compose configuration to properly handle environment variables by removing the conflicting environment section, ensuring that variables from the .env file take precedence.

Changes Made

  • Removed environment section: Eliminated the environment section in docker-compose.yml to prevent overriding variables from .env file. Now, environment variables from .env are properly applied.

Problem Addressed

  • Environment override issue: Previously, variables like SET_MESSAGES_AS_SEEN in .env were ignored because Docker Compose's environment section has higher priority.
  • This ensures that production configurations in .env are respected without manual overrides in the compose file.

Testing Instructions

  1. Ensure a .env file exists with necessary variables (copy from .env.example if needed).
  2. Run docker-compose up to test the setup.
  3. Verify that environment variables from .env are applied correctly (e.g., message seen behavior).

Related Issues

  • Fixes the issue where .env variables were not being read in production.
  • Related to #41 (messages always marked as read).

sonarta and others added 6 commits September 1, 2025 15:45
- Move dotenv config to the top of server.js
- Update docker-compose.yml to properly handle .env file
- Remove duplicate environment variables section

This ensures BASE_PATH and TRUST_PROXY work as expected in both Docker and local environments.
@sonarta sonarta changed the title Fix environment variable override in Docker Compose fix: environment variable override in Docker Compose Sep 8, 2025
@sonarta sonarta changed the title fix: environment variable override in Docker Compose fix: Environment variable override in Docker Compose Sep 8, 2025
@avoylenko avoylenko merged commit b4d6664 into avoylenko:main Sep 10, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants