PromucFlow_constructor/deploy/docker/fs/opt/appsmith/start_app.sh
Shrikant Sharat Kandula c594699eac
chore: Use single COPY command in Dockerfile for constant/static files (#27127)
Move the files that are copied into the Docker image, into an `fs`
folder, that reflects the folder structure of that in the image. This
means two things right away:

1. A single `COPY` instruction in `Dockerfile` is enough to copy all the
files to their places.
2. The structure of files in the repo reflects that in the Docker image.
This makes working with the files/folders and troubleshooting with them
much easier.

 Note: **There's actually only 3 files changed, rest are just moved.**
2023-09-11 08:43:09 +05:30

26 lines
763 B
Bash

#!/bin/bash
install_dir="$1"
cd "$install_dir" \
&& echo "Start application..." \
&& mv "$install_dir/stacks/data/backup/appsmith-data.archive" "$install_dir/stacks/data/restore" \
&& docker-compose up -d
wait_for_containers_start() {
local timeout=$1
while [[ $timeout -gt 0 ]]; do
status_code="$(curl -s -o /dev/null -w "%{http_code}" http://localhost/api/v1 || true)"
if [[ status_code -eq 401 ]]; then
break
else
echo -ne "Waiting for all containers to start. This check will timeout in $timeout seconds...\r\c"
fi
((timeout--))
sleep 1
done
}
wait_for_containers_start 180
# Force import DB to ignore confirm step
docker-compose exec -T appsmith appsmithctl import_db -f