Replicated does not currently support the Docker Compose feature env_file which makes it possible to extract your common environment variables and clean up your spec.
Docker added extension fields as of Compose version 3.4. This makes it possible to re-use configuration fragments in your Compose YAML. We can make use of YAML anchors and aliases to achieve something similar to the env_file feature.
---
# kind: scheduler-swarm
version: '3.4'
x-custom:
shared_env: &shared_env
RELEASE_CHANNEL: unstable
VERSION: 2.21.0
services:
replicated:
environment:
<<: *shared_env
PROJECT_NAME: replicated
replicated-ui:
environment:
<<: *shared_env
PROJECT_NAME: replicated-ui
replicated-operator:
environment:
<<: *shared_env
PROJECT_NAME: replicated-operator