Run GlitterGallery in a container#259
Conversation
|
@sarupbanskota, @EmilyDirsh I hope you can help me with this :) |
There was a problem hiding this comment.
It's good to specify a version number, usually the LTS version - which would be 14.04.
There was a problem hiding this comment.
Sure. That should definitely done in production :)
You're building an image here, not a container. I'd suggest replacing
That's good to run GlitterGallery in a setup where you just want to set it up and forget about it. If you're actively developing, it's better to mount a volume from the docker host into the container - here's how that'd look:
This way, all changes made to files will reflect in the container. I'm a bit doubtful about how this will work with bundler (if gems are installed in the /glittergallery folder, they'll be overwritter). If that is the case, we'll have to configure bundler to install gems elsewhere. One more advantage of this is - you'd retain the development database even if you launch a new container. |
|
@rohitpaulk Thank you very much for the detailed feedback :) I posted this just as a starting point.
Yeah, or in other words "production" :) Thanks again. I really appreciate your feedback |
|
Feel free to continue to work on this Ubuntu based image, if that's what you prefer working with. I'd want our promoted "official" image to be Fedora based, given that Glitter Gallery originated with the Fedora design team :) |
|
@EmilyDirsh I'm planning to change it to Fedora :)... Funny thing here is that I was actually downloading Fedora for my own machine during the past few days(internet here is not the fastest 😢 ) I was facing problems on my old system getting the image to run(discovered at the end that I had no space left in my root.) Just today as I removed my old system and switched to Fedora that I got this Ubuntu based image to work :). |
|
@rohitpaulk I've applied the suggestions you made(updated my description as well). I could run the app in development, make modifications and see them directly. I think next step is to run a container with guard running :) @EmilyDirsh now using Fedora :) |
|
Do we really need rvm in the container? The only reason I can think of wanting to switch ruby versions within a container I'm going to use for GG development is to check if some bug is introduced in a project because of a change we introduced when we were on a previous version. That's something that'll have to reflect on the Dockerfile anyway. Am I missing something? |
|
@sarupbanskota yeah I was thinking actually about that but found out that the official available ruby packages is not always the last one. The easiest alternative is RVM. If you think I should use another way to get the latest ruby with specifying the version, please let me know it :). |
|
I'm thinking we should have the Dockerfile in a separate repo. That's standard from what I've seen of other docker repos. |
|
@EmilyDirsh well, I was thinking of including that file in the repo here and adding something in the instructions in the Get Involved page to tell contributors they can optionally develop that way since this dockerfile is now for development. For the production one(probably won't be a single file), it might be better to move them into another repo. |
|
Fixes #239 |
I tried to learn about Docker and managed to run GlitterGallery in a container for development through this docker file.
Instructions:
-install docker.
-cd to GG directory
-run
docker build -t glittergallery .-run
docker run -d -v $PWD:/srv -p 3000:3000 glittergallery-navigate to "localhost:3000" and enjoy :)
To make this run in production, I think we need to setup another container with mysql and connect them. Also we might want to use Passenger.
I just want to make sure that I'm working on the right track for handling #239 .