| 123456789101112131415161718192021 |
- {#
- Archetype: service-environment-v1
-
- Description:
- Sets environment variables directly in the compose file.
-
- Approach:
- - Always includes TZ (timezone) variable
- - Swarm-compatible (env_file doesn't work in Swarm mode)
- - Can be extended with additional environment variables
-
- Usage:
- Use for services that need environment variables set directly.
- This approach works in both standard Docker Compose and Swarm mode.
-
- Notes:
- - For sensitive data in Swarm mode, use secrets instead
- - For many variables in standard mode, consider env_file archetype
- #}
- environment:
- - TZ={{ container_timezone }}
|