ajnisbet / opentopodata

Open alternative to the Google Elevation API!
https://www.opentopodata.org
MIT License
312 stars 69 forks source link

Docker container run: Error: could not find config file /app/docker/supervisord.conf #73

Closed achso18 closed 1 year ago

achso18 commented 1 year ago

I am building the docker image using the provided Dockerfile like so docker build --tag opentopodata --file .\docker\Dockerfile .

When trying to run the container with the docker run command: docker run --rm -it --volume /opentopodata/data:/app/data:ro -p 5000:5000 opentopodata

I get the following error:

Error: could not find config file /app/docker/supervisord.conf
For help, use /usr/bin/supervisord -h

I tried with different commands in the run.sh file but it is always complaining about missing files. I checked in the container and they are definitely there.

Modifying the docker run command in such a way starts up the server successfully: docker run --rm -it --volume /opentopodata/data:/app/data:ro -p 5000:5000 opentopodata sh -c "exec env N_UWSGI_THREADS=2 /usr/bin/supervisord -c /app/docker/supervisord.conf"

Any idea what could be wrong?

ajnisbet commented 1 year ago

Huh, that's an odd one and not something I've encountered, thanks for sharing the solution!

Are you running on windows? And on the latest 1.8.3 version of opentopodata?

Also would you mind trying with the alternative image (it's called m1, but should work on any platform):

docker build --tag opentopodata  --file .\docker\apple-silicon.Dockerfile .
docker run --rm -it --volume /opentopodata/data:/app/data:ro -p 5000:5000 opentopodata

I'm stumped by the issue, but that would at least indicate if there's something wrong with supervisord/dependencies or with docker (the two images use the same approach to launching the service, but use different base images and dependency versions).

achso18 commented 1 year ago

Hey Andrew. Thanks for the quick reply. Yes, it is quite buffling, but I think, I found the reason. I tried the other Dockerfile, but also without success.

Although, executing the cmd directly on the command line works just fine. So it must have something to do with the run.sh file.

So, I am on a Windows machine with Docker Desktop and VSCode. I remembered some stupid error I once had before... Writing bash scripts in VSCode and then trying to execute them on a Linux VM. The error then had also nothing to do with the actual problem: it is the line endings! grafik

As soon as I changed them to "LF", it worked like charm 😃

ajnisbet commented 1 year ago

Ok good to know thanks!

I'm not familiar with windows, but it wouldn't surprise me if some tools can handle linux-style line ending and others can't.