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.

  • task number is larger than replicas in swarm mode
  • How to profile nodejs app for memory leaks inside docker container?
  • apt-get fails in Debian and Ubuntu based docker images
  • Running docker image does not work
  • Where to put folders for code in docker containers
  • Couchbase XDCR in a Docker container
  • 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?

  • Limit Network access but allow a specific IP for a Running Docker Container
  • Piping contents to docker image
  • Docker-compose corrupted directory when shared a multiple file/directory in the same mounting point
  • Wrong credentials when connecting to Docker MySQL container
  • What shall I give the ip adress of redis container to which tomcat will connect through source code Docker volume
  • How to use Dockerfile to link main container to a db 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.