Add Seeds file after Dokku build

206 views Asked by At

I am using dokku-alot to deploy my Rails 4 app to my staging server and everything is working just swell.

One requirement I have with my current project is in regards to seed file data. I've had to keep my seeds.rb file out of version control because of sensitive information. However, I can't figure out how to add the seeds.rb file into the container after a build.

I've tried ssh root@myhost ap_name which gets me into the VM but even if I scp the files into there, the container doesn't see them. How can I drop a few files where my rails code is in the docker image?

1

There are 1 answers

0
paulcpederson On BEST ANSWER

Depending on how much information is in your seeds.rb file, you could use environmental variables. This the solution I ended up using.

You basically set the variable: config:set my-app SECRET=whateversupersecretinfo. Then in your code, you can extract that app variable by using ENV['SECRET']. (This works pretty much the same in Heroku) Not sure if that would solve your use case, but leaving this answer here for posterity.

subnote: In Node.js you can extract these variables like process.env.SECRET