Skip to main content

Docusaurus

Follow these steps to deploy Docusaurus using Argonaut to your Kubernetes or AWS Lambda environments.

Account Setup

  1. Create an Argonaut account by visiting https://ship.argonaut.dev.
  2. You can change the organization name from the settings icon on the top right.
  3. Click the blue banner on top or head over to cloud connect page under settings to connect your AWS account using IAM.
  4. Create a new environment
    1. Click on the Infrastructure tab.
    2. Click on create an environment, give it a name (e.g., test, prod) & choose the region.
  5. Connect to your Git account. We currently support GitHub & GitLab.

Application config

Add an application

  1. Click on the Applications tab and the deploy button.
  2. Choose the Git repository where your Docusaurus app is located.
  3. Select your runtime environment. Choose between (2) AWS Lambda and (3) Kubernetes. Here is more information on the starting stack that we provision on AWS.

AWS Lambda

  1. Choose your environment and the application name.
  2. Specify build details
    1. Build context would be something other than . if it is a monorepo.
    2. Install Dependencies: npm install
    3. Build Command: npm run build
    4. Run Command: npm start
    5. Port number is 3000
  3. Choose memory size, timeout, and custom domain hosted on AWS Route53.
  4. Upload your secrets via a .env file.
  5. Click on Deploy.

Lambda app information

Kubernetes

  1. Choose your environment.

  2. Select your target clusters or create new.

  3. Connect your source

    1. Service Name: Name your Docusaurus app my-docs
    2. Service Type: Stateless
    3. Path: Path to dockerfile in your repo like ./docusaurus/Dockerfile. Alternately, buildpacks can be used for automatic detection and deployment.
      1. Docusaurus requires Node.js 16.14 or above
      2. Include: RUN npm install command
      3. Include: RUN npm start command
    4. Working Directory: Location in your repo where your commands are executed
    5. Service Config: .art/docusaurus-test.yaml
    6. Container Registry: ecr
  4. Network settings and scaling

    1. Container port number: Docusaurus by default runs on 3000. Expose your port in the Dockerfile if you're changing this port number.
    2. Type of Network: HTTPS is used for Docusaurus
    3. Host Name: The URL to access your Docusaurus application docusaurus.mywebsite.com
    4. Resource Requests & Limits: Set CPU and Memory values. 0.5 CPU and 500M memory is a good start.
    5. Enable horizontal autoscaling
    6. Health Check: Can be used to report status via HTTP GET
  5. Upload secrets for the app environment on the k8s cluster.

    1. Secrets are Key-Value pairs added to your k8s environment.
    2. They can be used during runtime or buildtime.
    3. Easily drop your .env file or add secrets manually.
    4. Mount files such as certificates as secrets to your kubernetes pods.
  6. Click on Deploy

  7. Add a CNAME for the hostname to the loadbalancer to access the app.

    Kubernetes app information

  8. After clicking Deploy, you’ll be taken to the deployment Logs. Your application is now being deployed. Check the output section of the logs.

  9. Now, go to the Applications page and look for your Docusaurus application.

  10. You can get the deployed URL from the applications page, and you have now successfully deployed your Docusaurus application.