Add Seeds file after Dokku build

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.

  • Docker containers with one public IP
  • Docker port binding doesn't seem to work
  • Docker 1.13 stack deploy with global service malfunction (target replicas increase without limit)
  • Docker django Import Error : No module named 'social'
  • Why don't docker use the host OS for all purposes
  • What causes the EB cli to package an app as file name 1 (app-123456-654321.zip) vs file name 2 (9f1b.zip)?
  • 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?

  • Openstack Nova docker implement security group
  • Dockerfile: mkdir and COPY commands run fine but I can't see the directory and file
  • Docker(compose) installing nodejs broke npm
  • Python script for creating docker container using Remote API
  • Mystery of the Restarting Docker Container
  • docker pull hello-world - msg=“filesystem layer verification failed for digest”
  • One Solution collect form web for “Add Seeds file after Dokku build”

    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

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.