I think that the main problem is that the Dockerfile and the current configuration don't allow both services (Ollama and Nginx) to be started simultaneously.
Why ?
(1) Incomplete Dockerfile
The original only contains:
FROM ollama/ollama:latest
FROM nginx:latest
COPY /.nginx/nginx.conf /etc/nginx/conf.d/default.conf
This Dockerfile does not specify how to launch the services or how they will interact together.
(2) The logs are clear about this
In the provided logs, clear connection errors are visible:
[error] 29#29: *1 connect() failed (111: Connection refused) while connecting to upstream
This error indicates that Nginx cannot connect to Ollama, suggesting that the Ollama service is not started or not accessible.