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.

  • How to deploy a echo app to Marathon (on Mesos on Docker on Mac)?
  • Assigning docker container to a recieved from outside port with Python
  • Docker Dev: Golang: Is Layer.Size() equivalent to the sum of Metadata.Size in []layer.Metadata?
  • Docker-compose volumes doesn't copy any files
  • prevent Docker from exposing port on host
  • Docker run tomcat image without port mapping
  • 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?

  • How to connect to MySQL running on Docker from the host machine
  • Docker Error bind: address already in use
  • Execute script inside docker container which is folder different than WORKDIR
  • Docker containers with one public IP
  • Copy all SBT dependencies to local folder
  • Running multiple applications in one docker container
  • 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.