Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dockerfile for the app - image works with openshift/kubernetes too #81

Merged
merged 1 commit into from
May 17, 2018
Merged

Conversation

sfarosu
Copy link
Contributor

@sfarosu sfarosu commented May 12, 2018

Created this dockerfile for passwordpusher app. It works with docker/openshift/kubernetes too. I could also work on an openshift template to create all the objects + persistent storage if there's no support in the app for mysql.

Image available here: https://hub.docker.com/r/sfarosu/passwordpusher/

@pglombardo
Copy link
Owner

Great stuff @sfarosu. If we set RAILS_ENV=production and configure config/database.yml, we could make the production environment support/run mysql or postgresql out of the box. (Support exists, it just needs to be configured)

In the Dockerfile, the would then be:

ENV=RAILS_ENV=production
ENTRYPOINT [ "bundle", "exec", "foreman", "start", "web" ]

But could a single Docker image also run postgres or would that have to be broken out into a separate image?

@sfarosu
Copy link
Contributor Author

sfarosu commented May 16, 2018

To be honest i think we should concentrate on the real deal, Openshift and Kubernetes. Don't think there are many people running the app manually. But still in this case i would see a docker compose with 2 containers, one i've built + one with mysql or whatever and it's data (volume) would be saved on the host machine in a folder so it survives container recreation not only restarts.

On the other hand making a nice openshift template with deployments would be more attractive, with one simple command you could run the whole thing.

In any case, let's do both, so if you can prepare config/database.yml for mysql i'll start working on docker compose.

@pglombardo
Copy link
Owner

Good points - I agree. And actually, if we set an ENV var of DATABASE_URL, it can point to any remote database and it overrides the config/database.yaml automatically . Much easier/simpler.

e.g.

DATABASE_URL=postgresql://user:pw@host:5432/db
DATABASE_URL=mysql://user:pw@host:5432/db

I'll merge and update the docs/README separately. (unless you want to do this by all means...)
I'll add a separate issue to add an Openshift template.

Thanks for the help!

@pglombardo pglombardo merged commit 850e5bf into pglombardo:master May 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants