Compose file version 3 reference
These topics describe version 3 of the Compose file format. This is the newest version. There are several versions of the Compose file format - 1, 2, 2.x, and 3.x. The table below is a quick look. For full details on what each version includes and how to upgrade, see About versions and upgrading .
https://docs.docker.com/compose/compose-file/compose-file-v3/#environment
Environment variables in Compose
There are multiple parts of Compose that deal with environment variables in one sense or another. This page should help you find the information you need.
https://docs.docker.com/compose/environment-variables/

Seonglae Cho