Im trying to run a docker container and load environment variables from my .env file which is in the same root directory as the rest of the project. For context, my .env file looks something like this:
SERVICE_KEY = `{
"type": "anything",
"project_id": "anything",
"private_key_id": "anything",
"private_key": "anything",
"client_email": "anything",
"client_id": "anything",
"auth_uri": "anything",
"token_uri": "anything",
"auth_provider_x509_cert_url": "anything",
"client_x509_cert_url": "anything"
}`
It is a JSON string that has back ticks `` with spaces around it to allow for parsing. It is part of a NodeJs application and I am using the dotenv package to find and initialize the environment variable. The app runs fine on my machine
When I run a command like this: $ docker run -p 3000:3000 -d --env-file ./.env image-name im getting an error: docker: poorly formatted environment: variable '"project_id": "my-image",' contains whitespaces.
I know there are similar questions that have been asked here but none of those solutions help, I was wondering if anyone could point me in the right direction.