From b6720e7fe9b6ce7acb978871a2fb63905ae24ce1 Mon Sep 17 00:00:00 2001 From: Kyriakos Akriotis Date: Wed, 3 Jul 2024 10:37:56 +0200 Subject: [PATCH] removed redundant files, brought back lost changes in config.ts #1 --- .devcontainer/devcontainer.json | 46 -------------------------- .devcontainer/docker-compose.yaml | 47 -------------------------- .devcontainer/docsearch-config.json | 20 ----------- .devcontainer/docusaurus-2.json | 51 ----------------------------- .devcontainer/nginx-default.conf | 13 -------- .devcontainer/post-create-script.sh | 11 ------- Dockerfile2 | 40 ---------------------- docker-compose.debug.yml | 14 -------- docker-compose.yml | 12 ------- docusaurus.config.ts | 18 +++++----- 10 files changed, 9 insertions(+), 263 deletions(-) delete mode 100644 .devcontainer/devcontainer.json delete mode 100644 .devcontainer/docker-compose.yaml delete mode 100644 .devcontainer/docsearch-config.json delete mode 100644 .devcontainer/docusaurus-2.json delete mode 100644 .devcontainer/nginx-default.conf delete mode 100755 .devcontainer/post-create-script.sh delete mode 100644 Dockerfile2 delete mode 100644 docker-compose.debug.yml delete mode 100644 docker-compose.yml diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json deleted file mode 100644 index ffdc9cec7..000000000 --- a/.devcontainer/devcontainer.json +++ /dev/null @@ -1,46 +0,0 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the -// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node -{ - "name": "docs-next", - // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile - "image": "mcr.microsoft.com/devcontainers/typescript-node:1-20-bullseye", - "customizations": { - "vscode": { - "extensions": [ - "ms-vscode.vscode-typescript-next", - "dsznajder.es7-react-js-snippets", - "msjsdiag.vscode-react-native", - "burkeholland.simple-react-snippets", - "christian-kohler.npm-intellisense", - "christian-kohler.path-intellisense", - "mutantdino.resourcemonitor", - "mhutchie.git-graph", - "unifiedjs.vscode-mdx", - "xyc.vscode-mdx-preview", - "vadistic.mdx-inline", - "yzhang.markdown-all-in-one", - "DavidAnson.vscode-markdownlint", - "redhat.vscode-yaml" - ] - } - }, - "features": { - "ghcr.io/devcontainers/features/docker-in-docker:2": {}, - "ghcr.io/devcontainers/features/github-cli:1": {} - }, - - // Features to add to the dev container. More info: https://containers.dev/features. - // "features": {}, - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [3000], - - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "bash .devcontainer/post-create-script.sh", - - // Configure tool-specific properties. - // "customizations": {}, - - // Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root. - "remoteUser": "root" -} diff --git a/.devcontainer/docker-compose.yaml b/.devcontainer/docker-compose.yaml deleted file mode 100644 index e187530a6..000000000 --- a/.devcontainer/docker-compose.yaml +++ /dev/null @@ -1,47 +0,0 @@ -name: typesense -services: - nginx: - hostname: nginx.docs.next - image: nginx:1-alpine - ports: - - 80:80 - volumes: - - ./nginx-default.conf:/etc/nginx/conf.d/default.conf - restart: always - depends_on: - - typesense - extra_hosts: - - "host.docker.internal:host-gateway" - typesense: - ports: - - 8108:8108 - volumes: - - typesense_data:/data - image: typesense/typesense:26.0 - command: --data-dir /data --api-key=${TYPESENSE_API_KEY} --enable-cors=true - hostname: typesense.docs.next - healthcheck: - test: ['CMD', 'curl', 'http://localhost:8108'] - interval: 5s - timeout: 3s - retries: 5 - extra_hosts: - - "host.docker.internal:host-gateway" - docsearch-scraper: - hostname: scraper.docs.next - restart: on-failure:5 - environment: - - CONFIG=${CONFIG_JSON} - - TYPESENSE_API_KEY=${TYPESENSE_API_KEY} - - TYPESENSE_HOST=typesense.docs.next - - TYPESENSE_PORT=8108 - - TYPESENSE_PROTOCOL=http - image: typesense/docsearch-scraper:0.9.1 - depends_on: - - nginx - extra_hosts: - - "host.docker.internal:host-gateway" -volumes: - typesense_data: - external: true - name: typesense_data \ No newline at end of file diff --git a/.devcontainer/docsearch-config.json b/.devcontainer/docsearch-config.json deleted file mode 100644 index fe4f52f7b..000000000 --- a/.devcontainer/docsearch-config.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "index_name": "docs-next", - "start_urls": [ - { - "url": "http://nginx.docs.next" - } - ], - "js_render": true, - "selectors": { - "lvl0": "h1", - "lvl1": "h2", - "lvl2": "h3", - "lvl3": "h4", - "lvl4": "h5", - "lvl5": "h6", - "text": "p, li" - }, - "strip_chars": " .,;:#" - } - \ No newline at end of file diff --git a/.devcontainer/docusaurus-2.json b/.devcontainer/docusaurus-2.json deleted file mode 100644 index f52c1c115..000000000 --- a/.devcontainer/docusaurus-2.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "index_name": "docs-next", - "start_urls": [ - "http://blueprints.hypelens.de/docs/blueprints/", - "http://blueprints.hypelens.de/docs/best-practices/" - ], - "sitemap_urls": [ - "http://blueprints.hypelens.de/sitemap.xml" - ], - "sitemap_alternate_links": true, - "stop_urls": [ - "/tests" - ], - "selectors": { - "lvl0": { - "selector": "(//ul[contains(@class,'menu__list')]//a[contains(@class, 'menu__link menu__link--sublist menu__link--active')]/text() | //nav[contains(@class, 'navbar')]//a[contains(@class, 'navbar__link--active')]/text())[last()]", - "type": "xpath", - "global": true, - "default_value": "Documentation" - }, - "lvl1": "header h1", - "lvl2": "article h2", - "lvl3": "article h3", - "lvl4": "article h4", - "lvl5": "article h5, article td:first-child", - "lvl6": "article h6", - "text": "article p, article li, article td:last-child" - }, - "strip_chars": " .,;:#", - "custom_settings": { - "separatorsToIndex": "_", - "attributesForFaceting": [ - "language", - "version", - "type", - "docusaurus_tag" - ], - "attributesToRetrieve": [ - "hierarchy", - "content", - "anchor", - "url", - "url_without_anchor", - "type" - ] - }, - "conversation_id": [ - "833762294" - ], - "nb_hits": 46250 - } \ No newline at end of file diff --git a/.devcontainer/nginx-default.conf b/.devcontainer/nginx-default.conf deleted file mode 100644 index f77f38cac..000000000 --- a/.devcontainer/nginx-default.conf +++ /dev/null @@ -1,13 +0,0 @@ -server { - listen 80; - server_name nginx.docs.next; - - location / { - proxy_pass http://host.docker.internal:3000; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - } -} \ No newline at end of file diff --git a/.devcontainer/post-create-script.sh b/.devcontainer/post-create-script.sh deleted file mode 100755 index ab244700a..000000000 --- a/.devcontainer/post-create-script.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -yarn install - -export TYPESENSE_API_KEY=xyz -export CONFIG_JSON=$(cat .devcontainer/docsearch-config.json | jq -r tostring) - -cd .devcontainer - -docker-compose up -d - diff --git a/Dockerfile2 b/Dockerfile2 deleted file mode 100644 index b503d0a0e..000000000 --- a/Dockerfile2 +++ /dev/null @@ -1,40 +0,0 @@ -## Base ######################################################################## -# Use a larger node image to do the build for native deps (e.g., gcc, python) -FROM node:lts as base - -# Reduce npm log spam and colour during install within Docker -ENV NPM_CONFIG_LOGLEVEL=warn -ENV NPM_CONFIG_COLOR=false - -# We'll run the app as the `node` user, so put it in their home directory -WORKDIR /home/node/app -# Copy the source code over -COPY --chown=node:node . /home/node/app/ - -## Development ################################################################# -# Define a development target that installs devDeps and runs in dev mode -FROM base as development -WORKDIR /home/node/app -# Install (not ci) with dependencies, and for Linux vs. Linux Musl (which we use for -alpine) -RUN npm install -# Switch to the node user vs. root -USER node -# Expose port 3000 -EXPOSE 3000 -# Start the app in debug mode so we can attach the debugger -CMD ["npm", "start"] - -## Production ################################################################## -# Also define a production target which doesn't use devDeps -FROM base as production -WORKDIR /home/node/app -COPY --chown=node:node --from=development /home/node/app/node_modules /home/node/app/node_modules -# Build the Docusaurus app -RUN npm run build - -## Deploy ###################################################################### -# Use a stable nginx image -FROM nginx:stable-alpine as deploy -WORKDIR /home/node/app -# Copy what we've installed/built from production -COPY --chown=node:node --from=production /home/node/app/build /usr/share/nginx/html/ \ No newline at end of file diff --git a/docker-compose.debug.yml b/docker-compose.debug.yml deleted file mode 100644 index 00dec067c..000000000 --- a/docker-compose.debug.yml +++ /dev/null @@ -1,14 +0,0 @@ -version: '3.4' - -services: - docsnext: - image: docsnext - build: - context: . - dockerfile: ./Dockerfile - environment: - NODE_ENV: development - ports: - - 3000:3000 - - 9229:9229 - command: ["node", "--inspect=0.0.0.0:9229", "index.js"] diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index f6ef16883..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,12 +0,0 @@ -version: '3.4' - -services: - docsnext: - image: docsnext - build: - context: . - dockerfile: ./Dockerfile - environment: - NODE_ENV: production - ports: - - 3000:3000 diff --git a/docusaurus.config.ts b/docusaurus.config.ts index a68d53702..4284db15b 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -3,12 +3,12 @@ import type { Config } from '@docusaurus/types'; import type * as Preset from '@docusaurus/preset-classic'; const config: Config = { - title: 'Architecture Center docs-next', + title: 'Architecture Center docs-next.beta.5', tagline: 'Best Practices & Blueprints', favicon: 'img/favicon.ico', // Set the production url of your site here - url: 'https://blueprints.hypelens.de', + url: 'https://docs-next.hypelens.de', // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: '/', @@ -64,7 +64,7 @@ const config: Config = { ], ], - themes: ['docusaurus-theme-search-typesense'], + themes: ['docusaurus-theme-search-typesense'], themeConfig: { // Replace with your project's social card image: 'img/docusaurus-social-card.jpg', @@ -182,7 +182,7 @@ const config: Config = { autoCollapseCategories: true, }, }, - + typesense: { // Replace this with the name of your index/collection. // It should match the "index_name" entry in the scraper's "config.json" file. @@ -191,22 +191,22 @@ const config: Config = { typesenseServerConfig: { nodes: [ { - host: "blueprints.hypelens.de", - port: 8108, + host: "docs-search.hypelens.de", + port: 80, protocol: "http", }, ], - apiKey: "MureoeGWbndo4Ly17a4E7y64fZa8XxRb", + apiKey: "j2Q51UsLuh9guYtc4x147Mv5X74g4iSI", }, // Optional: Typesense search parameters: https://typesense.org/docs/0.24.0/api/search.html#search-parameters typesenseSearchParameters: {}, searchPagePath: false, - + // Optional contextualSearch: true, }, } satisfies Preset.ThemeConfig, }; -export default config; +export default config; \ No newline at end of file