diff --git a/production.Dockerfile b/production.Dockerfile index 7c8ef0a..5ada861 100644 --- a/production.Dockerfile +++ b/production.Dockerfile @@ -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"] diff --git a/render.yaml b/render.yaml index 529afb9..acc5f07 100644 --- a/render.yaml +++ b/render.yaml @@ -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