Error: ENOENT: no such file or directory, open '/app/.env'


#1

Hi.

I’ve just started working on an existing project and when I try to run it with Docker I get this error message:
Error: ENOENT: no such file or directory, open ‘/app/.env’

I have the .env file in the root of the project, and have tried moving it around, but still haven’t figured it out. Does anyone have a solution to this problem?


#2

Hi. Try to start your app like this:

ENV=/path/to/.env node server.js


#3

I get it to run just using node server.js, so it might be a problem with docker?


#4

You can disable .env file and directly use your system environment variables.

http://adonisjs.com/docs/4.0/configuration-and-env#_disabling_env_file