From 7289d1275e44c8be9551889b7ad2e831daaa37a1 Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:11:39 -0400 Subject: [PATCH 1/2] Add `just dc` recipe --- justfile | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index a12ac55e3..d03e36cc4 100644 --- a/justfile +++ b/justfile @@ -35,17 +35,21 @@ DOCKER_FILE := "-f " + ( export DOCKER_USER_ID := `id -u` export DOCKER_GROUP_ID := `id -g` +# Run `docker-compose` configured with the correct files and environment +dc *args: + docker-compose {{ DOCKER_FILE }} {{ args }} + # Build all (or specified) services build *args: - docker-compose {{ DOCKER_FILE }} build {{ args }} + just dc build {{ args }} # Bring all Docker services up up flags="": - docker-compose {{ DOCKER_FILE }} up -d {{ flags }} + just dc up -d {{ flags }} # Take all Docker services down down flags="": - docker-compose {{ DOCKER_FILE }} down {{ flags }} + just dc down {{ flags }} # Recreate all volumes and containers from scratch recreate: @@ -55,7 +59,7 @@ recreate: # Show logs of all, or named, Docker services logs services="" args=(if IS_CI != "" { "" } else { "-f" }): - docker-compose {{ DOCKER_FILE }} logs {{ args }} {{ services }} + just dc logs {{ args }} {{ services }} # Attach to the specificed `service`. Enables interacting with the TTY of the running service. attach service: From 30fd33e0392ffc1eb773412cbf0b5cfff81d9e80 Mon Sep 17 00:00:00 2001 From: sarayourfriend <24264157+sarayourfriend@users.noreply.github.com> Date: Wed, 17 Aug 2022 11:38:44 -0400 Subject: [PATCH 2/2] Add docs advising the usage of `just dc` instead of compose directly --- api/docs/guides/quickstart.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/api/docs/guides/quickstart.md b/api/docs/guides/quickstart.md index d277d4cbc..3bbfb6773 100644 --- a/api/docs/guides/quickstart.md +++ b/api/docs/guides/quickstart.md @@ -10,6 +10,8 @@ Ensure that you have installed `mkcert` (and the corresponding NSS tools). You can run `mkcert -install` to verify your installation. +> _**Note:**_ Our Docker compose configuration requires specific environment configuration that is automatically handled by `just`. While you can run compose directly, it's advised to use the `just dc` alias for `docker-compose` as this ensures the environment will be properly configured. + ## Steps 1. Ensure that the [Docker daemon](https://docs.docker.com/config/daemon/) is running.