Docker COPY command not working for .env

Hi everyone :slight_smile:
I have a strange bug on my docker build job on circleci.
On my script I generate a .env file with the node aws command. This file is correctly generated but during the yarn build the build script can’t find my .env file in /usr/src/.env
I thought it was my configuration, but if I run the run commands manually in circleci ssh, it works perfectly… Any idea ?

FROM mhart/alpine-node:10 as env

WORKDIR /usr/src
COPY aws.js /usr/src
RUN yarn add aws-sdk
COPY . .
RUN node aws ${SERVER_ENV}

FROM mhart/alpine-node:10 as base
WORKDIR /usr/src
COPY package.json yarn.lock /usr/src/
RUN yarn install
COPY . .
COPY --from=env /usr/src .
RUN yarn build

FROM mhart/alpine-node:10
WORKDIR /usr/src
COPY --from=base /usr/src .