Trying to get Render to run the migrations

This commit is contained in:
Ryan W
2023-09-30 21:23:39 -07:00
parent 9ce6995402
commit 5b576dbc16
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -75,6 +75,13 @@ 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"]
+1
View File
@@ -13,6 +13,7 @@ services:
region: oregon
branch: main
plan: free
# buildCommand: "./bin/render-build.sh"
dockerCommand: "bundle exec puma -C config/puma.rb"
numInstances: 1
healthCheckPath: /up