service-environment-v1.j2 813 B

12345678910111213141516171819202122232425
  1. {#
  2. Archetype: service-environment-v1
  3. Description:
  4. Environment variables for common container configurations.
  5. Approach:
  6. - Sets standard environment variables (timezone, UID/GID)
  7. - Demonstrates secret handling: file-based for swarm, env var for standalone
  8. - Uses user_uid/user_gid from module spec general section
  9. Usage:
  10. Use for services that need timezone and user/group configuration.
  11. Adapt the secret handling pattern for your specific secret variables.
  12. Replace SECRET example with actual secret variable names as needed.
  13. #}
  14. environment:
  15. - TZ={{ container_timezone }}
  16. - UID={{ user_uid }}
  17. - GID={{ user_gid }}
  18. {% if swarm_enabled %}
  19. - SECRET=/run/secrets/{{ secret_name }}
  20. {% else %}
  21. - SECRET=${SECRET}
  22. {% endif %}