json-schema-org / json-schema-org/website

🐛 Bug: refactor: Productionize Dockerfile for static site export

Open
#2,134 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

🐛 Bug Status: Stale Status: Triage
Dominant language
HTML
Stars
169
Forks
484
Avg merge
2d 2h
Merged PRs (30d)
6

Description

Describe the bug

DescriptionThe current Dockerfileis designed for development (CMD yarn dev) and does not align with the output: 'export' configuration in next.config.js This results in a heavy, slow container that includes development tools in production.

Steps To Reproduce

Navigate to the project root.
Run docker build -t website ..

Observation 1: The build fails because corepack is not enabled, but the project uses Yarn 4 (Berry).
Observation 2: Inspect Dockerfile line 17. It runs CMD yarn dev.

Observation 3: Inspect next.config.js. It has output: 'export', which requires a static build (next build), not a dev server.

Expected Behavior

Solution
Since the project is configured as a static site:

  1. Update Dockerfile to use a multi-stage build.
  2. Run next build (which performs the export) in the build stage.
  3. Use a lightweight server (e.g., nginx:alpine or serve) to serve the static out/ directory in the final stage.
  4. Remove yarn dev from the container command.
Screenshots

No response

Device Information [optional]
- OS:
- Browser:
- version:
Are you working on this issue?

Yes

Do you think this work might require an [Architectural Decision Record (ADR)]? (significant or noteworthy)

Yes

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the Dockerfile and next.config.js, then run the documented docker build command to reproduce the corepack failure. Verify that the build uses the static export configuration and that the resulting out/ directory is served by the production container rather than yarn dev.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, nextjs
Domain
build-system, devops, web-dev
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.