From 5133f09a92eb9e461ed5413b0b4076aad8a484b1 Mon Sep 17 00:00:00 2001 From: Nigel Gott <nigel@baserow.io> Date: Wed, 12 May 2021 12:35:06 +0000 Subject: [PATCH] Resolve "Small baserow docker doc + docker improvements" --- docker-compose.yml | 16 ++++++++++++++ .../running-the-dev-environment.md | 7 ++++-- docs/guides/baserow-docker-how-to.md | 22 ++++++++++++++++++- docs/guides/running-baserow-locally.md | 7 ++++-- docs/reference/baserow-docker-api.md | 20 ++++++++++++++++- 5 files changed, 66 insertions(+), 6 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 79ffdb50a..0e985c5b3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -49,6 +49,13 @@ services: - DATABASE_NAME=${DATABASE_NAME:-baserow} - ADDITIONAL_APPS - MEDIA_URL=http://localhost:${MEDIA_PORT:-4000}/media/ + - EMAIL_SMTP + - EMAIL_SMTP_HOST + - EMAIL_SMTP_PORT + - EMAIL_SMPT_USE_TLS + - EMAIL_SMTP_USER + - EMAIL_SMTP_PASSWORD + - FROM_EMAIL ports: - "${BACKEND_PORT:-8000}:8000" depends_on: @@ -70,6 +77,15 @@ services: command: celery depends_on: - backend + environment: + - ADDITIONAL_APPS + - EMAIL_SMTP + - EMAIL_SMTP_HOST + - EMAIL_SMTP_PORT + - EMAIL_SMPT_USE_TLS + - EMAIL_SMTP_USER + - EMAIL_SMTP_PASSWORD + - FROM_EMAIL volumes: - media:/baserow/media networks: diff --git a/docs/development/running-the-dev-environment.md b/docs/development/running-the-dev-environment.md index 344a79729..6baf31c49 100644 --- a/docs/development/running-the-dev-environment.md +++ b/docs/development/running-the-dev-environment.md @@ -24,6 +24,9 @@ If you haven't already installed docker and docker-compose on your computer you so by following the instructions on https://docs.docker.com/desktop/ and https://docs.docker.com/compose/install/. +> Docker version 20.10.0 is the minimum required to build Baserow. Please check that +> your docker is up to date by running `docker -v`. + You will also need git installed which you can do by following the instructions on https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/ . @@ -33,9 +36,9 @@ the following commands in your terminal. ``` $ docker -v -Docker version 19.03.8, build afacb8b +Docker version 20.10.6, build 370c289 $ docker-compose -v -docker-compose version 1.25.5, build 8a1c60f6 +docker-compose version 1.26.2, build eefe0d31 $ git --version git version 2.24.3 (Apple Git-128) ``` diff --git a/docs/guides/baserow-docker-how-to.md b/docs/guides/baserow-docker-how-to.md index 1853ef0df..4b63c0c70 100644 --- a/docs/guides/baserow-docker-how-to.md +++ b/docs/guides/baserow-docker-how-to.md @@ -3,6 +3,9 @@ Find below a list of FAQs and common operations when working with Baserow's docker environment. +> Docker version 20.10.0 is the minimum required to build Baserow. Please check that +> your docker is up to date by running `docker -v`. + See [baserow's docker api](../reference/baserow-docker-api.md) for the full details on what commands and environment variables baserow's docker-compose and docker image's support. @@ -53,6 +56,16 @@ $ # or using dev.sh $ POSTGRES_PORT=5555 REDIS_PORT=6666 MJML_PORT=7777 ./dev.sh ``` +### Configure an external email server + +See [the introduction](../getting-started/introduction.md) for the all the of email +environment variables available to configure Baserow. For a simple example you can start +up Baserow locally and have it connect to an external SMTP server like so: + +```bash +EMAIL_SMTP_HOST=TODO EMAIL_SMTP_PORT=TODO EMAIL_SMTP=True docker-compose up +``` + ### Change the container user When running the dev env you can set the `UID` and `GID` environment variables when @@ -116,12 +129,19 @@ $ ./dev.sh run backend manage sync_templates ## Common Problems +### Build Error - Service 'backend' failed to build: unable to convert uid/gid chown + +This error occurs when attempting to build Baserow's docker images with a version of +Docker earlier than 20.10.0. You can check your local docker version by +running `docker -v` and fix the error by installing the latest version of Docker from +https://docs.docker.com/get-docker/. + ### Permission denied errors If you used Baserow's dev env prior to April 2021 with the provided docker files you might encounter permission errors in the containers when upgrading. With the old docker files build output could end up being owned by root. These root owned files if they -still exist in your repo will cause a problem starting the new dev env as Baserow's +still exist in your repo will cause a problem starting the new dev env as Baserow's containers now run as a non-root user. To fix simply ensure all files in your baserow git repo are owned by your current user diff --git a/docs/guides/running-baserow-locally.md b/docs/guides/running-baserow-locally.md index aa0db304d..4b4d8cc11 100644 --- a/docs/guides/running-baserow-locally.md +++ b/docs/guides/running-baserow-locally.md @@ -21,6 +21,9 @@ If you haven't already installed docker and docker-compose on your computer you so by following the instructions on https://docs.docker.com/desktop/ and https://docs.docker.com/compose/install/. +> Docker version 20.10.0 is the minimum required to build Baserow. Please ensure your +> your docker is up to date by running `docker -v`. + You will also need git installed which you can do by following the instructions on https://www.linode.com/docs/development/version-control/how-to-install-git-on-linux-mac-and-windows/. @@ -29,9 +32,9 @@ following commands in your terminal. ``` $ docker -v -Docker version 19.03.8, build afacb8b +Docker version 20.10.6, build 370c289 $ docker-compose -v -docker-compose version 1.25.5, build 8a1c60f6 +docker-compose version 1.26.2, build eefe0d31 $ git --version git version 2.24.3 (Apple Git-128) ``` diff --git a/docs/reference/baserow-docker-api.md b/docs/reference/baserow-docker-api.md index c63cfba4c..c29742224 100644 --- a/docs/reference/baserow-docker-api.md +++ b/docs/reference/baserow-docker-api.md @@ -124,8 +124,26 @@ Backend configuration: - `SYNC_TEMPLATES_ON_STARTUP` (default `true`) : When `true` on backend server startup it will run the baserow management command `sync_templates` which loads any templates found in `./backend/templates` into Baserow. + +Pass through variables: -### Dev Only Variables +These environment variables when provided to the docker-compose files are passed through +to the correct containers. See [the introduction](../getting-started/introduction.md) +for what these variables do. + +- `PUBLIC_BACKEND_URL` +- `PUBLIC_WEB_FRONTEND_URL` +- `MEDIA_URL` +- `EMAIL_SMTP` +- `EMAIL_SMTP_HOST` +- `EMAIL_SMTP_PORT` +- `EMAIL_SMPT_USE_TLS` +- `EMAIL_SMTP_USER` +- `EMAIL_SMTP_PASSWORD` +- `FROM_EMAIL` + + +### Dev Only Variables - `UID` (default `1000` or your user id when using `./dev.sh`) : Sets which user id will be used to build Baserow's images with and the user id which will be used to run the