Deploy Docsy inside a Docker container

Instructions on how to setup and run a local Docsy site with Docker.

We provide a Docker image that you can use to run and test your Docsy site locally, without having to install all Docsy’s dependencies.

Install the prerequisites

  1. On Mac and Windows, download and install Docker Desktop. On Linux, install Docker engine and Docker compose.

    The installation may require you to reboot your computer for the changes to take effect.

  2. Install git.

Create your repository from the docsy-example template

The docsy-example repository provides a basic site structure that you can use as starting point to create your own documentation.

  1. Use the docsy-example template to create your own repository.

  2. Download the code to your local machine by cloning your newly created repository.

  3. Change your working directory to the newly created folder:

    cd docsy-example
    

Build and run the container

The docsy-example repository includes a Dockerfile that you can use to run your site.

  1. Build the docker image:

    docker-compose build
    
  2. Run the built image:

    docker-compose up
    
  3. Open the address http://localhost:1313 in your web browser to load the docsy-example homepage. You can now make changes to the source files, those changes will be live-reloaded in your browser.

Cleanup

To cleanup your system and delete the container image follow the next steps.

  1. Stop Docker Compose with Ctrl + C.

  2. Remove the produced images

    docker-compose rm
    

What’s next?


Last modified January 10, 2023: add content from docsy userguide (6b676a8)