1

Analogous to: this question, I have a rails app I wish to deploy with dokku by doing something like:

git push dokku master

The app requires a database.yml and other config.yml files that contain a lot of secret information. In the repository these files are gitignored for obvious reasons. (There is only a database.yml.example and config.yml.example file committed, with the secret information removed.)

Dokku fails to build and deploy the app, complaining that these configuration files are missing.

How can I deploy my app, using dokku, without committing my configuration files to git?

I don't want to create a separate branch and unignore them. I'd like to maintain my own version of these files on the server (where dokku runs). I just want dokku to find or copy them from a local directory on the server. How can that be done?

MathKid
  • 1,903
  • 1
  • 21
  • 21

1 Answers1

1

Why do you want to commit these files in the first place? Using config files for sensitive information is considered bad practice.

It is recommend you set up environment variables instead as per the official documentation.

Then you can access these variables in your code:

# Python
import os
database_password = os.environ.get("DATABASE_PASSWORD")

# Java
String database_password = System.getenv("DATABASE_PASSWORD")

# PHP
$database_password = getenv("DATABASE_PASSWORD");

# Go
import "os"

os.Getenv("FOO")
Born2Discover
  • 145
  • 1
  • 3
  • 9