Next.JS does NOT support Docker Swarm.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 142k
- Forks
- 32.4k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 351
Description
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked sandercokart.com reproduction and its Next.js 14.2.11 standalone output configuration. Reproduce the deployment with docker service create and docker stack deploy, then compare the empty localhost:3000 response with the working nginx service and inspect the container behavior. Done means the deployed webpage loads through Docker Swarm instead of returning an empty reply.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, next.js, react
- Domain
- devops, infrastructure
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100