I am using restart: always but my service still looks up after it crashes.
company:
build:
dockerfile: Dockerfile
context: ./company
container_name: company
ports:
- "3005:3005"
restart: always
volumes:
- .:/app
- /app/company/node_modules
company | [nodemon] app crashed – waiting for file changes before starting…
nginx-proxy-1 | 172.18.0.1 – – [19/Aug/2024:20:30:16 +0000] “GET /company/applications HTTP/1.1” 502 559 “http://localhost/company/applications/:89” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36”
nginx-proxy-1 | 2024/08/19 20:30:16 [error] 30#30: *13 connect() failed (111: Connection refused) while connecting to upstream, client: 172.18.0.1, server: , request: “GET /company/applications HTTP/1.1”, upstream: “http://172.18.0.3:3005/applications”, host: “localhost”, referrer: “http://localhost/company/applications/:89”
company find-internship-company–company “docker-entrypoint.s…” company 9 minutes ago Up
9 minutes 0.0.0.0:3005->3005/tcp
I was expecting it to restart after the crash but it didn’t even exit with a exit code.
Ahmet Said Barkahan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.