Skip to content

Windows Docker Setup

You should have already downloaded Docker and cloned the repository.

Enabling the WSL Terminal within VS Code

There are scripts in the s/ which streamline the setup for the development process. Unfortunately, Windows does not natively support running these through the Command Prompt. Instead, we must first install the Windows Subsystem for Linux (WSL) to run the scripts.

VS Code has a helpful extension to do just this!

Follow this guide (Windows Subsystem for Linux VSCode Extension) to enable usage of a Ubuntu (WSL) terminal within VS Code.

Running Scripts

Open a new WSL terminal by selecting it:

Screenshot of WSL Terminal in VS Code

If you haven't already, cd into the root folder

cd rcpch-audit-engine/

Finally, you should be able to run the setup script by typing:

sh s/up

Setup errors

Sometimes, the easiest fix for many headaches, relating to installation and setup, is to simply restart your computer and try again!

WSL <> Powershell <> Windows Caddy Certificate

Though WSL is required for the Docker setup, a few additional steps are needed related to Caddy Certificates.

First, ensure all the Docker containers are running by running sh s/up inside a WSL2 terminal, as described in the previous step.

To get the Caddy Certificate, open a Powershell terminal in the same directory. Powershell is required because the steps to install the Certificate are OS-specific, and we need the Windows installation.

Verify the containers are running and visible to PS. Open a PS terminal, as an administrator, navigate to the project folder and type:

Powershell terminal
docker compose ps

Which should result in something like:

Powershell terminal
NAME                                IMAGE                             COMMAND                  SERVICE             CREATED             STATUS              PORTS
rcpch-audit-engine-caddy-1          caddy                             "caddy run --config …"   caddy               27 minutes ago      Up 19 minutes       0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 443/udp, 2019/tcp
rcpch-audit-engine-django-1         rcpch-audit-engine-django         "sh -c 'python manag…"   django              27 minutes ago      Up 19 minutes
rcpch-audit-engine-mkdocs-1         rcpch-audit-engine-mkdocs         "sh -c 'mkdocs build…"   mkdocs              27 minutes ago      Up 19 minutes       0.0.0.0:8001->8001/tcp
rcpch-audit-engine-postgis-1        postgis/postgis:15-3.3            "docker-entrypoint.s…"   postgis             27 minutes ago      Up 19 minutes       5432/tcp

Next, type:

Powershell terminal
docker compose cp caddy:/data/caddy/pki/authorities/local/root.crt %TEMP%/root.crt

Which will copy the root.crt from inside the caddy container into %TEMP%.

Finally, install the certificate by typing:

Powershell terminal
certutil -addstore -f "ROOT" %TEMP%/root.crt

Close and re-open Chrome, and everything should be working!