From 3f3f94f290a7a39c2c5300a6c5a22bf0bc913999 Mon Sep 17 00:00:00 2001 From: Ryan W Date: Sat, 30 Sep 2023 21:55:05 -0700 Subject: [PATCH] Render is using ENTRYPOINT now --- bin/docker-entrypoint-production | 4 ++++ production.Dockerfile | 7 ------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/bin/docker-entrypoint-production b/bin/docker-entrypoint-production index 9f35ff4..2f1b9ba 100755 --- a/bin/docker-entrypoint-production +++ b/bin/docker-entrypoint-production @@ -9,4 +9,8 @@ echo "${*}" # ./bin/rails db:prepare # fi +# Run database migrations when deploying to Render. It is not great, maybe there's a better way? +# https://community.render.com/t/release-command-for-db-migrations/247/6 +if [ -z "$RENDER" ]; then echo "var is unset"; else bin/rails db:migrate; fi + exec "${@}" diff --git a/production.Dockerfile b/production.Dockerfile index 5ada861..7c8ef0a 100644 --- a/production.Dockerfile +++ b/production.Dockerfile @@ -75,13 +75,6 @@ RUN useradd rails --create-home --shell /bin/bash && \ chown -R rails:rails db log storage tmp USER rails:rails -# Run database migrations when deploying to Render. It is not great, maybe there's a better way? -# https://community.render.com/t/release-command-for-db-migrations/247/6 -ARG RENDER -ARG DATABASE_URL -ARG SECRET_KEY_BASE -RUN if [ -z "$RENDER" ]; then echo "var is unset"; else bin/rails db:migrate; fi - # Entrypoint prepares the database. ENTRYPOINT ["/rails/bin/docker-entrypoint-production"]