Environment variables are closely related to the technology of Docker. They are usually written in the .env or .txt file right in the project directory.
The main reason for using environment variables is to improve the flexibility of your application when using Docker. You can for example use a PORT environment variable to specify on which port to run a backend application (e.g., PORT=80).
Environment variables are associated with application components. To update or create environment variables, you thus need the associated component to exist, or be in the process of creating it.