From 8643dd894eec60318cfdc90d212f8d2dafc5c26c Mon Sep 17 00:00:00 2001 From: Anatoli Nicolae Date: Mon, 25 Mar 2024 14:04:28 +0100 Subject: [PATCH] Added Dockerfile-related notes Signed-off-by: Anatoli Nicolae Make notes more visible Signed-off-by: Anatoli Nicolae --- docs/docker.md | 27 +++++++++++++++++++++++++++ docs/get-started.md | 5 +++++ 2 files changed, 32 insertions(+) diff --git a/docs/docker.md b/docs/docker.md index b7326b750..b368fd7de 100644 --- a/docs/docker.md +++ b/docs/docker.md @@ -43,6 +43,33 @@ This will make sure you have a DATABASE that you are ready to connect to. docker exec -it shelf npm run setup:seed ``` +## Development + +> [!CAUTION] +> During development involving Dockerfile changes, make sure to **address the correct Dockerfile** in your builds: +> - Fly.io will be built via `Dockerfile` +> - ghcr.io will be built via `Dockerfile.image` + +By default both Fly.io and Docker will build via `Dockerfile` unless specifically instructed. Learn more [about Fly.io Config](https://fly.io/docs/reference/configuration/#specify-a-dockerfile) and [Docker image builds](https://docs.docker.com/reference/cli/docker/image/build/#file). + +In order to build a local Docker image just as the one we provide for self-hosting, you'll have to build `Dockerfile.image` using buildx as follows: + +```sh +docker buildx build \ + --platform linux/amd64,linux/arm64 `# use --platform to instruct x86 and ARM build` \ + --tag shelf-local \ + --file Dockerfile.image . +``` + +Then running the locally-built image should be as simple as: + +```sh +docker run -d \ + --name "shelf" \ + -e ... `# your env vars` \ + shelf-local +``` + ### ARM processors You can also run shelf on ARM64 processors. diff --git a/docs/get-started.md b/docs/get-started.md index 8922f5006..350b7443b 100644 --- a/docs/get-started.md +++ b/docs/get-started.md @@ -107,6 +107,11 @@ The database seed script creates a new user with some data you can use to get st - Email: `hello@supabase.com` - Password: `supabase` +> [!CAUTION] +> During development involving Dockerfile changes, make sure to **address the correct file** in your builds: +> - Fly.io will be built via `Dockerfile` +> - ghcr.io will be built via `Dockerfile.image` + ## Authentication For authentication to work in your Project, you need so setup some settings related to One Time Passwords in Supabase.