-
Notifications
You must be signed in to change notification settings - Fork 212
Add dockerfile #432
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
Merged
Merged
Add dockerfile #432
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker-ception
The build actually finishes!
Also set environment variables, mount rustwide workspace
only mark sources as out of date, not dependencies
it will get build anyway when the server runs builds in the background and this makes it easier for development
The container is running things as root anyway in order to be able to communicate with docker
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested this locally and it works great! Left a few comments though.
Co-Authored-By: Pietro Albini <[email protected]>
Removed the duplicate files, thanks for the review! |
Thanks for making this! |
This was referenced Nov 4, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I went over this with @pietroalbini in Discord - Since the Vagrantfile is out of date, it's hard to build docs.rs locally. This pull allows anyone with
docker-compose
installed to get started as fast as they can build the crates.Overview
Most of the build happens in the Dockerfile and is cached. The only changes that happen after the docker container starts are building the documentation for each crate (which is cached, since it's stored in the mounted Rustwide volume) and performing the database migrations, which are cached in practice since no one will be deleting the database container for the fun of it.
The webserver does run as root in the docker container, which rustwide requires in order to be able to communicate with docker. Although we could add the
cratesfyi
user to thedocker
group, there's no way to make sure that the mounted docker socket in the container has the same GID as the host.Changes
--foreground
flag forcratesfyi daemon
(needed for docker)0.0.0.0
when it can't determine a hostname, not127.0.0.1