Skip to content

Commit

Permalink
Merge pull request #107 from hotosm/fix/backend-entrypoint
Browse files Browse the repository at this point in the history
fix: index.html download always on restart & rm migration from entrypoint script
  • Loading branch information
spwoodcock authored Jul 30, 2024
2 parents 91fcce3 + 22acfd8 commit f0b0522
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/backend/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,8 @@ wait_for_minio() {
}

get_frontend_index_html() {
if [ ! -f /project/src/backend/templates/index.html ]
then
echo "/project/src/backend/templates/index.html file does not exist...trying to download from object storage.."
curl --fail --create-dirs ${S3_ENDPOINT}/${FRONTEND_BUCKET_NAME}/index.html --output /project/src/backend/templates/index.html || echo "Failed to download index.html... Please retry manually for now...."
else
echo "/project/src/backend/templates/index.html found. Continuing..."
fi
echo "Downloading index.html from object storage.."
curl --fail --create-dirs ${S3_ENDPOINT}/${FRONTEND_BUCKET_NAME}/index.html --output /project/src/backend/templates/index.html || echo "Failed to download index.html... Please retry manually for now...."
}

# Start wait in background with tmp log files
Expand All @@ -52,9 +47,6 @@ wait_for_minio &
get_frontend_index_html &
wait

# Migrations
pdm run alembic upgrade head

exec "$@"

exit 0

0 comments on commit f0b0522

Please sign in to comment.