Complete the code to load environment variables from a file named .env in Docker Compose.
services:
app:
env_file: [1]The env_file option in Docker Compose specifies the file to load environment variables from. The default and common filename is .env.
Complete the .env file line to set the variable PORT to 8080.
PORT=[1]In a .env file, variables are set as KEY=VALUE. To set PORT to 8080, write PORT=8080.
Fix the error in this .env line to correctly set the variable DEBUG to true.
DEBUG=[1]In .env files, boolean values are usually lowercase without quotes. So DEBUG=true is correct.
Fill both blanks to create a .env line that sets the variable API_KEY to a secret value.
API_KEY=[1][2]
To set a string with letters in .env, wrap the value in double quotes: API_KEY="abcdef".
Fill all three blanks to write a Docker Compose environment section that uses the .env file and overrides PORT to 5000.
services:
web:
env_file: [1]
environment:
- PORT=[2]
- DEBUG=[3]This Docker Compose snippet loads variables from .env and overrides PORT to 5000 and DEBUG to true in the environment section.