From 74eb50aa1a911a3ca8ee996ea643c62c6dad97f2 Mon Sep 17 00:00:00 2001 From: Manish Gupta <59428681+mguptahub@users.noreply.github.com> Date: Fri, 10 May 2024 16:08:04 +0530 Subject: [PATCH] selfhosting fixes for custom branch and platform (#4431) --- deploy/selfhost/docker-compose.yml | 13 +++++++++++-- deploy/selfhost/install.sh | 10 ++++++---- deploy/selfhost/variables.env | 3 +++ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/deploy/selfhost/docker-compose.yml b/deploy/selfhost/docker-compose.yml index 67f61d0ef..6f58113be 100644 --- a/deploy/selfhost/docker-compose.yml +++ b/deploy/selfhost/docker-compose.yml @@ -42,6 +42,7 @@ services: web: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-frontend:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: unless-stopped command: node web/server.js web @@ -54,6 +55,7 @@ services: space: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-space:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: unless-stopped command: node space/server.js space @@ -66,7 +68,8 @@ services: admin: <<: *app-env - image: ${DOCKERHUB_USER:-makeplane}/plane-space:${APP_RELEASE:-stable} + image: ${DOCKERHUB_USER:-makeplane}/plane-admin:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: unless-stopped command: node admin/server.js admin @@ -79,6 +82,7 @@ services: api: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: unless-stopped command: ./bin/takeoff @@ -93,6 +97,7 @@ services: worker: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: unless-stopped command: ./bin/worker @@ -106,6 +111,7 @@ services: beat-worker: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: unless-stopped command: ./bin/beat @@ -119,6 +125,7 @@ services: migrator: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-backend:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} restart: no command: > @@ -138,6 +145,7 @@ services: command: postgres -c 'max_connections=1000' volumes: - pgdata:/var/lib/postgresql/data + plane-redis: <<: *app-env image: redis:7.2.4-alpine @@ -148,7 +156,7 @@ services: plane-minio: <<: *app-env - image: minio/minio + image: minio/minio:latest pull_policy: if_not_present restart: unless-stopped command: server /export --console-address ":9090" @@ -159,6 +167,7 @@ services: proxy: <<: *app-env image: ${DOCKERHUB_USER:-makeplane}/plane-proxy:${APP_RELEASE:-stable} + platform: ${DOCKER_PLATFORM:-} pull_policy: ${PULL_POLICY:-always} ports: - ${NGINX_PORT}:80 diff --git a/deploy/selfhost/install.sh b/deploy/selfhost/install.sh index aaf129524..b36d3b6b2 100755 --- a/deploy/selfhost/install.sh +++ b/deploy/selfhost/install.sh @@ -2,7 +2,8 @@ BRANCH=master SCRIPT_DIR=$PWD -PLANE_INSTALL_DIR=$PWD/plane-app +SERVICE_FOLDER=plane-app +PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER export APP_RELEASE=$BRANCH export DOCKERHUB_USER=makeplane export PULL_POLICY=always @@ -140,7 +141,7 @@ function download() { function startServices() { /bin/bash -c "$COMPOSE_CMD -f $DOCKER_FILE_PATH --env-file=$DOCKER_ENV_PATH up -d --quiet-pull" - local migrator_container_id=$(docker container ls -aq -f "name=plane-app-migrator") + local migrator_container_id=$(docker container ls -aq -f "name=$SERVICE_FOLDER-migrator") if [ -n "$migrator_container_id" ]; then local idx=0 while docker inspect --format='{{.State.Status}}' $migrator_container_id | grep -q "running"; do @@ -168,7 +169,7 @@ function startServices() { fi fi - local api_container_id=$(docker container ls -q -f "name=plane-app-api") + local api_container_id=$(docker container ls -q -f "name=$SERVICE_FOLDER-api") local idx2=0 while ! docker logs $api_container_id 2>&1 | grep -m 1 -i "Application startup complete" | grep -q "."; do @@ -408,7 +409,8 @@ fi # REMOVE SPECIAL CHARACTERS FROM BRANCH NAME if [ "$BRANCH" != "master" ]; then - PLANE_INSTALL_DIR=$PWD/plane-app-$(echo $BRANCH | sed -r 's@(\/|" "|\.)@-@g') + SERVICE_FOLDER=plane-app-$(echo $BRANCH | sed -r 's@(\/|" "|\.)@-@g') + PLANE_INSTALL_DIR=$PWD/$SERVICE_FOLDER fi mkdir -p $PLANE_INSTALL_DIR/archive diff --git a/deploy/selfhost/variables.env b/deploy/selfhost/variables.env index 91e206bb4..62c4bc164 100644 --- a/deploy/selfhost/variables.env +++ b/deploy/selfhost/variables.env @@ -43,3 +43,6 @@ FILE_SIZE_LIMIT=5242880 # Gunicorn Workers GUNICORN_WORKERS=1 + +# UNCOMMENT `DOCKER_PLATFORM` IF YOU ARE ON `ARM64` AND DOCKER IMAGE IS NOT AVAILABLE FOR RESPECTIVE `APP_RELEASE` +# DOCKER_PLATFORM=linux/amd64 \ No newline at end of file