Hi,
I have a rails app, and I have deployed the application using fly deploy
. I want to add some seed data like categories or tags in database tables.
I have added the following task definition
to fly.rake
file to create seed data in Postgres database,
# fly.rake
namespace :db do
task seed: :environment do
sh 'bin/rails db:recreate:seed'
end
end
And added the following to Dockerfile
generated by fly
,
#Dockerfile
ARG DB_SEED_COMMAND="bin/rails fly:db:seed RAILS_ENV=production"
RUN ${DB_SEED_COMMAND}
Question: After deployment is done, I don’t see the changes in Postgres. Where i am doing wrong,
Here is my database.yml
file
# config/database.yml
production:
<<: *default
database: db/production.sqlite3
I’m not sure how fly
will pick up postgres
without modifying the configuration in database.yml
.