diff --git a/docs/.gitignore b/docs/.gitignore index b2d6de3..1c4c1d8 100644 --- a/docs/.gitignore +++ b/docs/.gitignore @@ -18,3 +18,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +.k8s/remote*.yml +!.k8s/remote.example.yml \ No newline at end of file diff --git a/docs/.k8s/local.yml b/docs/.k8s/local.yml new file mode 100644 index 0000000..de0e08f --- /dev/null +++ b/docs/.k8s/local.yml @@ -0,0 +1,61 @@ +# ========================================= +# App manifest +# ========================================= + +--- +# App Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: m4g-docs-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: m4g-docs + template: + metadata: + labels: + app: m4g-docs + spec: + containers: + - name: m4g-docs + image: m4g_docs:latest + imagePullPolicy: Never + ports: + - containerPort: 80 + +--- +# App Service +apiVersion: v1 +kind: Service +metadata: + name: m4g-docs-service +spec: + selector: + app: m4g-docs + ports: + - protocol: TCP + port: 80 + targetPort: 80 + type: NodePort + +--- +# App Ingress +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: m4g-docs-ingress +spec: + ingressClassName: caddy + rules: + - host: m4g.docs.local + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: m4g-docs-service + port: + number: 80 diff --git a/docs/.k8s/remote.example.yml b/docs/.k8s/remote.example.yml new file mode 100644 index 0000000..af83779 --- /dev/null +++ b/docs/.k8s/remote.example.yml @@ -0,0 +1,67 @@ +# ========================================= +# App manifest +# ========================================= + +--- +# App Deployment +apiVersion: apps/v1 +kind: Deployment +metadata: + name: m4g-docs-deployment +spec: + replicas: 1 + selector: + matchLabels: + app: m4g-docs + template: + metadata: + labels: + app: m4g-docs + spec: + containers: + - name: m4g-docs + image: git.devdisciples.com/devdisciples/m4gdocs:latest + imagePullPolicy: Always + ports: + - containerPort: 80 + +--- +# App Service +apiVersion: v1 +kind: Service +metadata: + name: m4g-docs-service +spec: + selector: + app: m4g-docs + ports: + - protocol: TCP + port: 80 + targetPort: 80 + type: NodePort + +--- +# App Ingress +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: m4g-docs-ingress + annotations: + cert-manager.io/cluster-issuer: lets-encrypt +spec: + ingressClassName: public + tls: + - hosts: + - m4g.example.com + secretName: example-tls-secret + rules: + - host: m4g.example.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: m4g-docs-service + port: + number: 80 diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000..206a2de --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,27 @@ +# syntax=docker/dockerfile:1 + +# Stage 1: Base image. +## Start with a base image containing NodeJS so we can build Docusaurus. +FROM node:lts AS base +## Disable colour output from yarn to make logs easier to read. +ENV FORCE_COLOR=0 +## Enable corepack. +RUN corepack enable +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus + +# Stage 2b: Production build mode. +FROM base AS prod +## Set the working directory to `/opt/docusaurus`. +WORKDIR /opt/docusaurus +## Copy over the source code. +COPY . /opt/docusaurus/ +## Install dependencies with `--immutable` to ensure reproducibility. +RUN npm ci +## Build the static site. +RUN npm run build + +## Use a stable nginx image +FROM nginx:stable-alpine AS deploy +WORKDIR /home/node/app +COPY --chown=node:node --from=prod /opt/docusaurus/build/ /usr/share/nginx/html/ \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 0c6c2c2..6f3a789 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,3 +39,9 @@ $ GIT_USER= yarn deploy ``` If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. + + +### Custom + +kubectl --kubeconfig ~/.kube/main.k8s.config apply -f .k8s/remote.yml + diff --git a/docs/docs/command_plugins.md b/docs/docs/command_plugins.md index b04466f..b3b71b8 100644 --- a/docs/docs/command_plugins.md +++ b/docs/docs/command_plugins.md @@ -1,5 +1,5 @@ ---- -sidebar_position: 5 ---- - +--- +sidebar_position: 5 +--- + # Command plugins \ No newline at end of file diff --git a/docs/docs/getting_started.md b/docs/docs/getting_started.md index af08b39..d2583cd 100644 --- a/docs/docs/getting_started.md +++ b/docs/docs/getting_started.md @@ -1,28 +1,28 @@ ---- -sidebar_position: 2 ---- - -# Getting started - -## Requirements - -MycroForge has the following dependencies. - -- bash -- git -- Python3 (3.10) -- Docker -- .NET 8 - -### Windows - -To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment. -MycroForge has been developed and tested on Windows in WSL2 Ubuntu 22.04.03. -So when running on Windows, it's recommended to run MycroForge in the same environment or atleast in a similar WSL2 distro. - - -### Install - -``` -dotnet tool install -g MycroForge.CLI -``` +--- +sidebar_position: 2 +--- + +# Getting started + +## Requirements + +MycroForge has the following dependencies. + +- bash +- git +- Python3 (3.10) +- Docker +- .NET 8 + +### Windows + +To simplify the implementation of this tool, it assumes that it's running in a POSIX compliant environment. +MycroForge has been developed and tested on Windows in WSL2 Ubuntu 22.04.03. +So when running on Windows, it's recommended to run MycroForge in the same environment or atleast in a similar WSL2 distro. + + +### Install + +``` +dotnet tool install -g MycroForge.CLI +``` diff --git a/docs/package.json b/docs/package.json index 04e821a..4a962d1 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,7 +4,7 @@ "private": true, "scripts": { "docusaurus": "docusaurus", - "start": "docusaurus start", + "start": "docusaurus start --host 0.0.0.0", "build": "docusaurus build", "swizzle": "docusaurus swizzle", "deploy": "docusaurus deploy",