Open nuest opened 4 years ago
Use a multi-stage build to finally have an nginx-based image: https://docs.docker.com/develop/develop-images/multistage-build/
I have encountered a problem while fixin this issue.
I have created a multistage Dockerfile using nginx. And works in creating a production build And then deploying it with nginx.
At the moment it looks like this:
But when i start up the docker compose command. The ui container seems to be unable to the communicate to with the rest of the microservices. I get a 502 Bad Gateway
when tying to access the usual localhost Port.
In the Terinal this error is thrown:
webserver_1 | 2021/01/11 08:41:55 [error] 30#30: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "http://172.18.0.5:3000/favicon.ico", host: "localhost", referrer: "http://localhost/"
The problem seems to be that something in the internal routing is not working. I have tried a few things with different ports and the nginx.conf file. But nothing worked.
Please commit your changes to a branch and open a work-in-progress pull request. Looking at screenshots of files makes it very hard to look at problems.
Also: Do you have no problems with the regular docker-compose configuration? Did you do a docker-compose down -v --rmi all
to be sure that there are no mix-ups with the existing images of the compose configuration?
The
Dockerfile.dev
can use the development server, but the production image should have a prebuild app, not the least for reasons of performance:Related to #57