json-schema-org / json-schema-org/website
🐛 Bug: refactor: Productionize Dockerfile for static site export
Nobody has claimed this yet.
- 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:
- Update Dockerfile to use a multi-stage build.
- Run next build (which performs the export) in the build stage.
- Use a lightweight server (e.g., nginx:alpine or serve) to serve the static out/ directory in the final stage.
- 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
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 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