RedHatInsights / aiops-insights-clustering

Clustering of systems
GNU General Public License v3.0
1 stars 14 forks source link

Add Dockerfile #6

Closed tumido closed 6 years ago

tumido commented 6 years ago

For easier development it might be handy to be able to deploy locally in Docker. Here's a Dockerfile I use for quick deployment... This build is the same as in the OpenShift (Centos based)

Usage:

$ docker build . -t aicoe-insights-clustering --network=host
...

$ docker images
REPOSITORY             TAG                 IMAGE ID            CREATED             SIZE
clustering             latest              117a17806363        24 hours ago        994MB
...

$ cat env.list
FLASK_ENV=development
CEPH_KEY=...
CEPH_SECRET=...
CEPH_ENDPOINT=...

$ docker run --env-file env.list  -p 8080:8080 -it aicoe-insights-clustering
durandom commented 6 years ago

the s2i workflow is a bit different, as it installs requirements automatically and sets environment variables. I've been doing it locally like this: s2i build -c . centos/python-36-centos7 aicoe-insights-clustering docker run -p 8080:8080 -it aicoe-insights-clustering

So, tbh, I'd stick to the s2i workflow and not create a different way, which might lead to different results. OR you'll document this different approach properly and note the differences 😄

tumido commented 6 years ago

I see.. I didn't find any mention in README how to deploy locally, so I've gone the way I'm used to. :smile: However, I'm fine with the s2i. It make sense as it keeps the build as close to the prod env as possible. Would you be interested in me documenting the s2i way instead of introducing new, plain docker workflow? With more and more people onboarding it make sense to me. :wink: to have it documented.

tumido commented 6 years ago

Let's close this in favor of #7 which adds the local S2I build workflow to documentation.