Ports not exposed in NextJS app with nixpacks
I couldn't find information on the internet, I have basic nextjs14 app that needs ports exposed as .env variable set in Dokploy is "PORT=3002" and for some reason nixpacks don't detec't the port resulting in making Docker container that has not exposed ports, which means the app is not accessible by anyone. How do I fix that, because I can manually make "docker run [my created docker container here]" but that makes me doing everything from scratch and Dokploy isn't a solution then.

9 Replies
You don't need to expose the port to the main machine. Go to Domains and create a new random-generated domain, then add the port for your NextJS app.
Thanks, after fixing some issues in my side now I have situation where chat gpt is not so much helpful. Have you got any idea why trafeik makes me result of my website as “bad gateway” when accessing it trought browser but when I acccess it using http:3000 it works perfectly? Not sure even what logs to give you because there are no errors
that's what I get, but when i remove 's' and go for http:[my domain] with the port of app it work flawesly


docker-compose
found this error in traefik docker container logs, not sure if related:
2024-09-25T00:28:33Z ERR error="service \"dokploy-traefik\" error: port is missing" container=dokploy-traefik-jn5bc5ewkl4o6dhvopoe1zkrk providerName=swarm
Can you read this ?
https://docs.dokploy.com/en/docs/core/troubleshooting/overview
in the last version I added the most common questions, the answer to your problem is there
Overview
Solve the most common problems that occur when using Dokploy.
thank you so much
the correct solution for those who face similar issue:
hello