-
Notifications
You must be signed in to change notification settings - Fork 311
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
[WIP] Add support for Docker #1688
Conversation
I think this is a good idea. I suspect once Docker goes native it will greatly simplify the process of getting the site set up. Right now it sort of feels like you're learning how to be a ruby developer and I think the advantages here are great. Since we host the site (or will hopefully soon) on Federalist, it might make sense to look at how that project has handled some of these disadvantages. Addressing those specifically:
I see this as sort of a neutral issue. Since the repo itself is huge, it's already going to disadvantage people with slow connections but it is good to know where these slow points area.
Is there anything we should document around this?
We don't often add new gems, so we'd do this pretty infrequently and if we make sure to document when and how to do this, it seems pretty manageable. Plus, we get a lot of errors with gems and the gemfile right now because we're managing it on our own.
When Docker is native to Mac will these change? |
Yay! 💃
Ah, yeah, that makes sense. Cool, good to know!
Hmm, good question. I think there are a few common issues we could document, which I'm happy to take care of.
Ok, sounds good! On another project I've "hacked" this by making two separate Dockerfiles that build on each other: one contains the vast majority of dependencies and is actually downloadable from Docker Hub for quick install, while the other builds on the first and contains only the latest dependencies that haven't yet been added to the first. This generally allows new dependencies to be easily experimented with, though I'm not sure if this "hack" is used elsewhere.
Good question--unless Docker has added better support for uid/gid mapping in the past several months, then the answer is no. Hopefully better uid/gid mapping is a high priority for them, or has been fixed already; but if not, at this point I've written scripts in node, python, and ruby that do it for us, so no worries either way! |
Alright, I've just added an entrypoint that maps the uid of the container running the service to the uid of the host user. That way everything in @gboone, is there anything else you'd like me to change in this PR? |
Gaaaah! Was going to review this yesterday, then got stuck doing something else. Hopefully I'll get to it today but if not I'll review it when I'm back on Tuesday. Thanks @toolness and sorry left you on the hook. |
No worries @gboone, thanks for the update! |
By the way, I was just reminded that our dev standardization guides exist, so instead of putting Docker advice on every single repository that uses Docker, I thought it might be a better idea to improve the Docker guide and link to that. Here's the PR for it if you're interested: |
@toolness Looks like Docker for Mac native is now out of beta. Should this issue still be open? |
Woot! I think it just means the instructions we add to the README will be nice and simple? I don't think it means this issue should be closed without merging though... @gboone have you been able to take a look at this? Or was I supposed to do something? |
Yeah, I think just updating the README should be good. We should port this over to the beta.18f.gov repo, too |
@toolness can you change the target branch of this PR to |
Closed in favor of #1945 |
I'm not sure if this is actually a good idea or not, but after looking at the requirements for setting up the development server, I thought it might be useful to have a Docker setup for development.
Advantages:
Disadvantages:
slim
oralpine
alternatives to reduce the size, but regardless, people on a slow internet connection will be at a disadvantage here../go init
and then the building of a single gem, with Docker it'd require a re-run ofdocker-compose build
, which would then trigger a rebuilding of all gems.root
, not as the current user, which could mean weird file permissions for generated files. There's ways we can get around this, though.Anyways, not sure if the pros outweigh the cons but figured I'd throw it out here for feedback.
To try this out on OS X:
docker-compose up
.Still to do: