service-environment-v1.j2 651 B

123456789101112131415161718192021
  1. {#
  2. Archetype: service-environment-v1
  3. Description:
  4. Sets environment variables directly in the compose file.
  5. Approach:
  6. - Always includes TZ (timezone) variable
  7. - Swarm-compatible (env_file doesn't work in Swarm mode)
  8. - Can be extended with additional environment variables
  9. Usage:
  10. Use for services that need environment variables set directly.
  11. This approach works in both standard Docker Compose and Swarm mode.
  12. Notes:
  13. - For sensitive data in Swarm mode, use secrets instead
  14. - For many variables in standard mode, consider env_file archetype
  15. #}
  16. environment:
  17. - TZ={{ container_timezone }}