I run a Docker container on AWS EC2 and run a Ruby on Rails application.
The environment variable is managed with ENV file (gem of dotenv), but ENV file is not read.

source code:(controller)

If i enter APIKEY directly instead of ENV, it works properly.

In addition, ENV is working properly locally.

As you can see from this, will the ENV file not be read for some reason when operating on EC2?

Supplemental information (FW/tool version etc.)

ruby ​​'2.5.3'
dotenv (2.7.5)
dotenv-rails (2.7.5)
gem 'rails' '5.2.2'