From 9cb076d9e10d78749b806ea283c8645b8f3ebdf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Malfait?= Date: Thu, 21 Nov 2024 11:51:42 +0100 Subject: [PATCH] Improve docker compose (#8637) Add a proxy script to use the right install.sh branch/version matching the docker-compose Also stop exposing redis publicly as it's not necessary --- packages/twenty-docker/docker-compose.yml | 2 -- packages/twenty-docker/scripts/1-click.sh | 12 ++++++++++++ .../twenty-docker/scripts/install.sh | 0 .../developers/self-hosting/docker-compose.mdx | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 packages/twenty-docker/scripts/1-click.sh rename install.sh => packages/twenty-docker/scripts/install.sh (100%) diff --git a/packages/twenty-docker/docker-compose.yml b/packages/twenty-docker/docker-compose.yml index fcd485a28d..e44ee876c4 100644 --- a/packages/twenty-docker/docker-compose.yml +++ b/packages/twenty-docker/docker-compose.yml @@ -90,8 +90,6 @@ services: redis: image: redis - ports: - - "6379:6379" restart: always volumes: diff --git a/packages/twenty-docker/scripts/1-click.sh b/packages/twenty-docker/scripts/1-click.sh new file mode 100644 index 0000000000..2e5f935726 --- /dev/null +++ b/packages/twenty-docker/scripts/1-click.sh @@ -0,0 +1,12 @@ +pull_version=${VERSION:-$(curl -s https://api.github.com/repos/twentyhq/twenty/releases/latest | grep '"tag_name":' | cut -d '"' -f 4)} +pull_branch=${BRANCH:-$pull_version} + +version_num=${pull_version#v} +target_version="0.32.4" + +# We moved the install script to a different location in v0.32.4 +if [[ -n "$BRANCH" ]] || [[ "$(printf '%s\n' "$target_version" "$version_num" | sort -V | head -n1)" != "$version_num" ]]; then + curl -sL "https://raw.githubusercontent.com/twentyhq/twenty/$pull_branch/packages/twenty-docker/scripts/install.sh" | bash -s -- "$VERSION" "$BRANCH" +else + curl -sL "https://raw.githubusercontent.com/twentyhq/twenty/$pull_branch/install.sh" | bash -s -- "$VERSION" "$BRANCH" +fi diff --git a/install.sh b/packages/twenty-docker/scripts/install.sh similarity index 100% rename from install.sh rename to packages/twenty-docker/scripts/install.sh diff --git a/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx b/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx index e63a706c7a..9fdfb2fcb2 100644 --- a/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx +++ b/packages/twenty-website/src/content/developers/self-hosting/docker-compose.mdx @@ -31,7 +31,7 @@ bash <(curl -sL https://git.new/20) To install a specific version or branch: ```bash -VERSION=x.y.z BRANCH=branch-name bash <(curl -sL https://git.new/20) +VERSION=vx.y.z BRANCH=branch-name bash <(curl -sL https://git.new/20) ``` - Replace x.y.z with the desired version number. - Replace branch-name with the name of the branch you want to install.