Open fossamagna opened 1 year ago
Hey @fossamagna :wave: thanks for raising this! I was able to reproduce this by deploying the base docker-compose with Express.js template. To reproduce:
amplify init -y
amplify configure project
> Enable container-based deploymentsamplify add api
> REST > Docker Compose/Fargate/Express + Flaskdocker-compose.yml
version: '3.8'
services:
express:
build:
context: ./express
dockerfile: Dockerfile
ports:
- '8080:8080'
networks:
- public
- private
environment:
- MY_ENV_VAR=hello
env_file:
- .env
networks:
public:
private:
.env
file relative to the docker-compose file
MY_DOTENV_VAR=hello
amplify push -y
environmentFiles
is not populated in the task definition
Additionally, I can see the sample dotenv file in the source artifact zip archive and in a few other places in my deployment bucket:
Marking as a bug 🙂
How did you install the Amplify CLI?
npm
If applicable, what version of Node.js are you using?
v18.15.0
Amplify CLI Version
11.1.1
What operating system are you using?
Mac
Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.
No manual changes made
Describe the bug
In the documentation, env_file is included in the list of supported configurations in Docker compose file. However, the value set for env_file in docker-compose.yml is ignored. https://docs.amplify.aws/cli/usage/containers/#supported-configurations
Expected behavior
The description in the
env_file
must be respected; it must be reflected in EnvironmentFiles of ContainerDefinition.Reproduction steps
amplify configure project
. Enable container-based deployments.amplify add api
.. /express.env
.env_file
indocker-compose.yml
as. /express.env
.amplify push
Project Identifier
Project Identifier: a2b1a21124c9682206af329de433af89
Log output
Additional information
No response
Before submitting, please confirm: