diff --git a/docs/development-setup/running-locally.md b/docs/development-setup/running-locally.md new file mode 100644 index 000000000..e15046481 --- /dev/null +++ b/docs/development-setup/running-locally.md @@ -0,0 +1,35 @@ +# Running Locally + +How to run the app locally: + +1. Complete the steps in: + 1. [Local Development Environment](./local-development-environment.md) + 1. [Sandbox Environment](./sandbox.md) +1. Ensure the sandbox environment is running +1. `make install` +1. Login to the Openshift project `101ed4-prod` on the CLI +1. `make copy-db` +1. `make dev` + +## Troubleshooting + +### Canvas error + +**Problem** + +The `make install` command gives the error: + +``` +cd app/node_modules/.pnpm/canvas@3.2.0/node_modules/canvas &&\ + pnpm add -D node-gyp &&\ + pnpm exec node-gyp rebuild +bash: line 0: cd: app/node_modules/.pnpm/canvas@3.2.0/node_modules/canvas: No such file or directory +make: *** [canvas-install] Error 1 +``` + +**Solution** + +1. Comment out the `install: canvas-install` section in the [Makefile](https://github.com/bcgov/platform-services-registry/blob/main/Makefile) +1. `make install` +1. Uncomment the `install: canvas-install` section +1. `make install` diff --git a/docs/development-setup/sandbox.md b/docs/development-setup/sandbox.md index b7dd59e7d..867ad5777 100644 --- a/docs/development-setup/sandbox.md +++ b/docs/development-setup/sandbox.md @@ -4,9 +4,35 @@ The development sandbox serves as an isolated environment for local development ## Pre-requisites -- **[Docker Desktop](https://www.docker.com/products/docker-desktop/)** must be installed and running on your machine. - - For Windows, WSL2 is required. - - For macOS (Intel or Apple Silicon), ensure Docker Desktop is configured to use the appropriate architecture. +Due to BC Government procurement restrictions, Docker Desktop is not permitted. However, the following alternatives are approved: + +- Docker Engine (with Docker CLI) +- Podman +- Rancher Desktop + +### Docker Setup + +=== "Mac" + + 1. `brew install docker` + 1. `brew install docker-compose` + 1. `brew install docker-buildx` + 1. Add symlinks in `~/.docker/cli-plugins` + 1. `ln -s $HOMEBREW_PREFIX/lib/docker/cli-plugins/docker-buildx docker-buildx` + 1. `ln -s $HOMEBREW_PREFIX/lib/docker/cli-plugins/docker-compose docker-compose` + 1. Login to docker + 1. `docker login` + 1. Start VM. Example (using podman): + 1. `podman machine init` + 1. `podman machine start` + +=== "Windows" + + Refer to these blog posts on how to install Docker without Docker Desktop: + + * [How to install wsl2 ubuntu + docker + docker-compose](https://gist.github.com/martinsam16/4492957e3bbea34046f2c8b49c3e5ac0) + * [Mastering Docker on WSL2: A Complete Guide Without Docker Desktop](https://medium.com/h7w/mastering-docker-on-wsl2-a-complete-guide-without-docker-desktop-19c4e945590b) + * [Installing Docker, and Docker-Compose, in WSL2/Ubuntu on Windows](https://codingwithcalvin.net/installing-docker-and-docker-compose-in-wsl2ubuntu-on-windows/) ## Getting Started diff --git a/mkdocs.yml b/mkdocs.yml index c1c6c4777..f3520e6d8 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -75,6 +75,7 @@ nav: - development-setup/local-development-environment.md - development-setup/chartjs-canvas.md - development-setup/sandbox.md + - development-setup/running-locally.md - development-setup/onboarding-offboarding.md - development-setup/react-email.md - development-setup/resource-metrics.md diff --git a/sandbox/docker-compose-arm64.yml b/sandbox/docker-compose-arm64.yml index eab542c20..73ac55653 100644 --- a/sandbox/docker-compose-arm64.yml +++ b/sandbox/docker-compose-arm64.yml @@ -4,15 +4,27 @@ services: # See https://github.com/zcube/bitnami-compat/pkgs/container/bitnami-compat%2Fmongodb image: ghcr.io/zcube/bitnami-compat/mongodb:6.0-debian-11-r64@sha256:42b6d774c37dab8cb2a55a8a476281e56bb0eedd707c75956c7061c5904a1859 - # keycloak: - # platform: linux/arm64 + keycloak: + platform: linux/arm64 + + keycloak-provision: + platform: linux/arm64 + + m365proxy: + platform: linux/arm64 + container_name: m365proxy + build: + context: ./m365proxy + dockerfile: Dockerfile.arm64 + stdin_open: true + ports: + - 8000:8000 - # m365proxy: - # platform: linux/arm64 - # container_name: m365proxy - # build: - # context: ./m365proxy - # dockerfile: Dockerfile.arm64 - # stdin_open: true - # ports: - # - 8000:8000 + m365mock: + platform: linux/arm64 + + ches-mock: + platform: linux/arm64 + + nats-provision: + platform: linux/arm64