next.js
next.js copied to clipboard
Next.JS does NOT support Docker Swarm.
Link to the code that reproduces this issue
https://github.com/SanderCokart/sandercokart.com/tree/development
To Reproduce
docker service create
and docker stack deploy
both do launch the nodes and services but going to localhost:3000 results in nothing.
Current vs. Expected behavior
Going to localhost:3000 results in nothing.
Expected behavior: webpage shows up
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Pro
Available memory (MB): 65268
Available CPU cores: 16
Binaries:
Node: 20.17.0
npm: N/A
Yarn: N/A
pnpm: 9.11.0
Relevant Packages:
next: 14.2.11 // An outdated version detected (latest is 15.0.1), upgrade is highly recommended!
eslint-config-next: 14.2.11
react: 18.3.1
react-dom: 18.3.1
typescript: 5.6.2
Next.js Config:
output: standalone
Which area(s) are affected? (Select all that apply)
Output (export/standalone)
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
After a docker swarm init
you can run docker service create -p 80:80 --replicas 1 --name nginx nginx
and then visit localhost:80 (make sure to disable apache in wsl running sudo systemctl stop apache2.service
in wsl terminal) you can see the nginx welcome page.
Using curl to go to localhost:3000 you get this:
curl: (52) Empty reply from server