Skip to content

Serve docs statically#283

Open
runleveldev wants to merge 1 commit intomainfrom
runleveldev-patch-1
Open

Serve docs statically#283
runleveldev wants to merge 1 commit intomainfrom
runleveldev-patch-1

Conversation

@runleveldev
Copy link
Copy Markdown
Collaborator

@runleveldev runleveldev commented Apr 14, 2026

Rationale

The existing npm run serve service takes an additional port (2998) and introduces an extra hop to just serve static files. This PR allows NGINX to serve the files directly (which it excels at) avoiding port-in-use conflicts and simplifying operations.

Migration

  1. Restart container-creator.service
  2. cd mie-opensource-landing && npm run build
  3. Reload nginx config
  4. systemctl disable --now opensource-docs.service
  5. rm /etc/systemd/system/opensource-docs.service
  6. systemctl daemon-reload

Updating documentation after this patch

Instead of running systemctl restart opensource-docs.service just run cd mie-opensource-landing && npm run build

Copilot Summary

This pull request updates how the documentation site is served by switching from a Node.js-based server (managed by systemd) to serving the static build with nginx. The changes simplify deployment, remove unnecessary service management, and update Docker and nginx configurations accordingly.

Deployment and Service Management:

  • Removed the opensource-docs.service systemd service and all related installation and startup steps from the Makefile, so the docs site is no longer run as a Node.js process managed by systemd. [1] [2]

Docker and nginx Configuration:

  • Updated the images/docs/Dockerfile to install nginx, expose port 80 instead of 2998, and copy a new nginx configuration for serving the static documentation site.
  • Added images/docs/docs-site.conf, a new nginx config to serve the built documentation statically from /opt/opensource-server/mie-opensource-landing/build with security headers and proper fallback for missing files.
  • Modified the nginx configuration template in create-a-container/views/nginx-conf.ejs to serve the documentation statically instead of proxying to a Node.js server.

…s service

Replace the proxy_pass to localhost:2998 in the bare-domain nginx server
block with a root + try_files directive serving static files from the
Docusaurus build directory.

- nginx-conf.ejs: static file serving from /opt/opensource-server/mie-opensource-landing/build
- Makefile: remove systemd service install/enable/start from install-docs
- Delete mie-opensource-landing/systemd/opensource-docs.service
- Dockerfile: install nginx, serve on port 80, add standalone site config
- New images/docs/docs-site.conf for the test container

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@runleveldev runleveldev force-pushed the runleveldev-patch-1 branch from 8051f6f to 3dd75f5 Compare April 15, 2026 17:19
@runleveldev runleveldev changed the title Modify serve script to use port 2998 Serve docs statically Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant