-
Notifications
You must be signed in to change notification settings - Fork 210
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
Changes from 12 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4e0e5ca
Docker-ception
jyn514 e455bd6
now with fewer errors
jyn514 fd17975
install docker in docker container
jyn514 255c514
Add docker-compose for database
jyn514 48086b6
Fix docker-entrypoint script
jyn514 c7f475c
add option to run the server in the background
jyn514 6e95b04
make build after source changes much faster
jyn514 45f0904
cache more things in the dockerfile
jyn514 e34e238
allow connections from any IP
jyn514 a1fb331
add CSS to git
jyn514 9fd72f0
don't build rand before starting server
jyn514 66e134f
don't add cratesfyi to docker group
jyn514 9b8d40d
Log rustwide info in docker container
jyn514 cf2ebdc
remove duplicate files
jyn514 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.rustwide | ||
**/target |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
FROM rust:slim | ||
|
||
### STEP 1: Install dependencies ### | ||
# Install packaged dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
build-essential git curl cmake gcc g++ pkg-config libmagic-dev \ | ||
libssl-dev zlib1g-dev sudo docker.io | ||
|
||
### STEP 2: Create user ### | ||
ENV HOME=/home/cratesfyi | ||
RUN adduser --home $HOME --disabled-login --disabled-password --gecos "" cratesfyi | ||
|
||
### STEP 3: Setup build environment as new user ### | ||
ENV CRATESFYI_PREFIX=/home/cratesfyi/prefix | ||
RUN mkdir $CRATESFYI_PREFIX && chown cratesfyi:cratesfyi "$CRATESFYI_PREFIX" | ||
|
||
USER cratesfyi | ||
RUN mkdir -vp "$CRATESFYI_PREFIX"/documentations "$CRATESFYI_PREFIX"/public_html "$CRATESFYI_PREFIX"/sources | ||
RUN git clone https://github.com/rust-lang/crates.io-index.git "$CRATESFYI_PREFIX"/crates.io-index | ||
RUN git --git-dir="$CRATESFYI_PREFIX"/crates.io-index/.git branch crates-index-diff_last-seen | ||
|
||
### STEP 4: Build the project ### | ||
# Build the dependencies in a separate step to avoid rebuilding all of them | ||
# every time the source code changes. This takes advantage of Docker's layer | ||
# caching, and it works by copying the Cargo.{toml,lock} with dummy source code | ||
# and doing a full build with it. | ||
RUN mkdir -p ~/docs.rs ~/docs.rs/src/web/badge | ||
WORKDIR $HOME/docs.rs | ||
COPY --chown=cratesfyi Cargo.lock Cargo.toml ./ | ||
COPY --chown=cratesfyi src/web/badge src/web/badge/ | ||
RUN echo "fn main() {}" > src/main.rs && \ | ||
echo "fn main() {}" > build.rs | ||
|
||
RUN cargo fetch | ||
RUN cargo build --release | ||
|
||
### STEP 5: Build the website ### | ||
# Dependencies are now cached, copy the actual source code and do another full | ||
# build. The touch on all the .rs files is needed, otherwise cargo assumes the | ||
# source code didn't change thanks to mtime weirdness. | ||
RUN rm -rf src build.rs | ||
COPY --chown=cratesfyi src src/ | ||
COPY --chown=cratesfyi build.rs build.rs | ||
COPY --chown=cratesfyi templates templates/ | ||
RUN touch build.rs && find src -name "*.rs" -exec touch {} \; && cargo build --release | ||
|
||
ADD css $CRATESFYI_PREFIX/public_html | ||
|
||
ENV DOCS_RS_DOCKER=true | ||
COPY docker-entrypoint.sh ./ | ||
USER root | ||
ENTRYPOINT ./docker-entrypoint.sh |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `queue` crate."><meta name="keywords" content="rust, rustlang, rust-lang, queue"><title>queue - Rust</title><link rel="stylesheet" type="text/css" href="/normalize-20190820-1.39.0-nightly-bea0372a1.css"><link rel="stylesheet" type="text/css" href="/rustdoc-20190820-1.39.0-nightly-bea0372a1.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="/dark-20190820-1.39.0-nightly-bea0372a1.css"><link rel="stylesheet" type="text/css" href="/light-20190820-1.39.0-nightly-bea0372a1.css" id="themeStyle"><script src="/storage-20190820-1.39.0-nightly-bea0372a1.js"></script><noscript><link rel="stylesheet" href="/noscript-20190820-1.39.0-nightly-bea0372a1.css"></noscript><link rel="shortcut icon" href="/favicon-20190820-1.39.0-nightly-bea0372a1.ico"><style type="text/css">#crate-search{background-image:url("/down-arrow-20190820-1.39.0-nightly-bea0372a1.svg");}</style> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/menus-min.css" type="text/css" media="all" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/grids-min.css" type="text/css" media="all" /> | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css" type="text/css" media="all" /> | ||
<link rel="stylesheet" href="/style.css?0.6.0-4419dc8-2019-10-11" type="text/css" media="all" /> | ||
<link rel="search" href="/opensearch.xml" type="application/opensearchdescription+xml" title="Docs.rs"> | ||
</head> | ||
<body> | ||
<div class="nav-container nav-container-rustdoc"> | ||
<div class="container-rustdoc rustdoc-navigation"> | ||
<div class="pure-menu pure-menu-horizontal"> | ||
<form action="/releases/search" method="GET" class="landing-search-form-nav"> | ||
|
||
<input class="search-input-nav" name="query" aria-label="Find crate by search query" tabindex="-1" type="text" placeholder="Find crate"> | ||
|
||
<a href="/" class="pure-menu-heading pure-menu-link"><i class="fa fa-cubes fa-fw"></i><span class="title"> Docs.rs</span></a> | ||
|
||
<ul class="pure-menu-list"> | ||
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover"> | ||
<a href="/crate/queue/0.3.2-final" class="pure-menu-link" title="Simple wrapper around Vec to provide a FIFO queue."><i class="fa fa-fw fa-cube"></i><span class="title"> queue-0.3.2-final</span></a> | ||
<div class="pure-menu-children package-details-menu"> | ||
<!-- CRATE DETAILS --> | ||
<ul class="pure-menu-list menu-item-divided"> | ||
<li class="pure-menu-heading">queue</li> | ||
<li class="pure-menu-item"> | ||
<a href="/crate/queue/0.3.2-final" class="pure-menu-link" class="description"><i class="fa fa-fw fa-cube"></i> Simple wrapper around Vec to provide a FIFO queue.</a> | ||
</li> | ||
<li class="pure-menu-item"> | ||
<a href="/crate/queue/0.3.2-final" class="pure-menu-link"><i class="fa fa-fw fa-balance-scale"></i> MIT</a> | ||
</li> | ||
</ul> | ||
<div class="pure-g menu-item-divided"> | ||
<div class="pure-u-1-2 right-border"> | ||
<ul class="pure-menu-list"> | ||
<li class="pure-menu-heading">Links</li> | ||
<li class="pure-menu-item"><a href="https://rascul.gitlab.io/queue" class="pure-menu-link"><i class="fa fa-home fa-fw"></i> Homepage</a></li> | ||
<li class="pure-menu-item"><a href="https://docs.rs/queue" title="Canonical documentation" class="pure-menu-link"><i class="fa fa-fw fa-file-text"></i> Documentation</a></li> | ||
|
||
<li class="pure-menu-item"><a href="https://gitlab.com/rascul/queue" class="pure-menu-link"><i class="fa fa-code-fork fa-fw"></i> Repository</a></li> | ||
|
||
<li class="pure-menu-item"><a href="https://crates.io/crates/queue" class="pure-menu-link" title="See queue in crates.io"><i class="fa fa-cube fa-fw"></i> Crates.io</a></li> | ||
</ul> | ||
</div> | ||
<div class="pure-u-1-2"> | ||
<ul class="pure-menu-list"> | ||
<li class="pure-menu-heading">Authors</li> | ||
|
||
<li class="pure-menu-item"><a href="/releases/rascul" class="pure-menu-link"><i class="fa fa-fw fa-user"></i> rascul</a></li> | ||
|
||
</ul> | ||
</div> | ||
</div> | ||
<div class="pure-g"> | ||
<div class="pure-u-1-2 right-border"> | ||
<ul class="pure-menu-list"> | ||
<li class="pure-menu-heading">Dependencies</li> | ||
<li class="pure-menu-item"> | ||
<div class="pure-menu pure-menu-scrollable sub-menu"> | ||
<ul class="pure-menu-list"> | ||
|
||
</ul> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
<div class="pure-u-1-2"> | ||
<ul class="pure-menu-list"> | ||
<li class="pure-menu-heading">Versions</li> | ||
<li class="pure-menu-item"> | ||
<div class="pure-menu pure-menu-scrollable sub-menu"> | ||
<ul class="pure-menu-list"> | ||
|
||
<li class="pure-menu-item"><a href="/crate/queue/0.3.2-final" class="pure-menu-link">0.3.2-final</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/crate/queue/0.3.1" class="pure-menu-link">0.3.1</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/crate/queue/0.3.0" class="pure-menu-link">0.3.0</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/crate/queue/0.2.0" class="pure-menu-link">0.2.0</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/crate/queue/0.1.1" class="pure-menu-link">0.1.1</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/crate/queue/0.1.0" class="pure-menu-link">0.1.0</a></li> | ||
|
||
</ul> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
</li> | ||
|
||
<li class="pure-menu-item"> | ||
<a href="/crate/queue/0.3.2-final/source/" title="Browse source of queue-0.3.2-final" class="pure-menu-link"><i class="fa fa-fw fa-folder-open-o"></i><span class="title"> Source</span></a> | ||
</li> | ||
<li class="pure-menu-item pure-menu-has-children pure-menu-allow-hover"> | ||
<a href="#" class="pure-menu-link" aria-label="Platform"><i class="fa fa-fw fa-gears"></i><span class="title"> Platform</span></a> | ||
<ul class="pure-menu-children"> | ||
|
||
<li class="pure-menu-item"><a href="/queue/0.3.2-final/i686-apple-darwin/queue/" class="pure-menu-link">i686-apple-darwin</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/queue/0.3.2-final/i686-pc-windows-msvc/queue/" class="pure-menu-link">i686-pc-windows-msvc</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/queue/0.3.2-final/i686-unknown-linux-gnu/queue/" class="pure-menu-link">i686-unknown-linux-gnu</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/queue/0.3.2-final/x86_64-apple-darwin/queue/" class="pure-menu-link">x86_64-apple-darwin</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/queue/0.3.2-final/x86_64-pc-windows-msvc/queue/" class="pure-menu-link">x86_64-pc-windows-msvc</a></li> | ||
|
||
<li class="pure-menu-item"><a href="/queue/0.3.2-final/x86_64-unknown-linux-gnu/queue/" class="pure-menu-link">x86_64-unknown-linux-gnu</a></li> | ||
|
||
</ul> | ||
</li> | ||
|
||
|
||
|
||
|
||
</ul> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="rustdoc mod container-rustdoc"> | ||
<!--[if lte IE 8]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu">☰</div><a href="../queue/index.html"><div class="logo-container"><img src="/rust-logo-20190820-1.39.0-nightly-bea0372a1.png" alt="logo"></div></a><p class="location">Crate queue</p><div class="sidebar-elems"><a id="all-types" href="all.html"><p>See all queue's items</p></a><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class="location"></p><script>window.sidebarCurrent = {name: 'queue', ty: 'mod', relpath: '../'};</script></div></nav><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!"><img src="/brush-20190820-1.39.0-nightly-bea0372a1.svg" width="18" alt="Pick another theme!"></button><div id="theme-choices"></div></div><script src="/theme-20190820-1.39.0-nightly-bea0372a1.js"></script><nav class="sub"><form class="search-form js-only"><div class="search-container"><div><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"></div><a id="settings-menu" href="../settings.html"><img src="/wheel-20190820-1.39.0-nightly-bea0372a1.svg" width="18" alt="Change settings"></a></div></form></nav><section id="main" class="content"><h1 class="fqn"><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">−</span>]</a></span><a class="srclink" href="../src/queue/lib.rs.html#1-306" title="goto source code">[src]</a></span><span class="in-band">Crate <a class="mod" href="">queue</a></span></h1><div class="docblock"><p>A simple and easy wrapper around <code>Vec</code> to implement a FIFO queue. This is | ||
no fancy, advanced data type but something simple you can use easily until | ||
or unless you need something different.</p> | ||
<h1 id="example" class="section-header"><a href="#example">Example</a></h1> | ||
<div class="example-wrap"><pre class="rust rust-example-rendered"><span class="kw">use</span> <span class="ident">queue</span>::<span class="ident">Queue</span>; | ||
|
||
<span class="kw">let</span> <span class="kw-2">mut</span> <span class="ident">q</span> <span class="op">=</span> <span class="ident">Queue</span>::<span class="ident">new</span>(); | ||
|
||
<span class="ident">q</span>.<span class="ident">queue</span>(<span class="string">"hello"</span>).<span class="ident">unwrap</span>(); | ||
<span class="ident">q</span>.<span class="ident">queue</span>(<span class="string">"out"</span>).<span class="ident">unwrap</span>(); | ||
<span class="ident">q</span>.<span class="ident">queue</span>(<span class="string">"there!"</span>).<span class="ident">unwrap</span>(); | ||
|
||
<span class="kw">while</span> <span class="kw">let</span> <span class="prelude-val">Some</span>(<span class="ident">item</span>) <span class="op">=</span> <span class="ident">q</span>.<span class="ident">dequeue</span>() { | ||
<span class="macro">println</span><span class="macro">!</span>(<span class="string">"{}"</span>, <span class="ident">item</span>); | ||
}</pre></div> | ||
<p>Outputs:</p> | ||
<pre><code class="language-text">hello | ||
out | ||
there! | ||
</code></pre> | ||
</div><h2 id="structs" class="section-header"><a href="#structs">Structs</a></h2> | ||
<table><tbody><tr class="module-item"><td><a class="struct" href="struct.Queue.html" title="queue::Queue struct">Queue</a></td><td class="docblock-short"><p>A first in, first out queue built around <code>Vec</code>.</p> | ||
</td></tr></tbody></table></section><section id="search" class="content hidden"></section><section class="footer"></section><aside id="help" class="hidden"><div><h1 class="hidden">Help</h1><div class="shortcuts"><h2>Keyboard Shortcuts</h2><dl><dt><kbd>?</kbd></dt><dd>Show this help dialog</dd><dt><kbd>S</kbd></dt><dd>Focus the search field</dd><dt><kbd>↑</kbd></dt><dd>Move up in search results</dd><dt><kbd>↓</kbd></dt><dd>Move down in search results</dd><dt><kbd>↹</kbd></dt><dd>Switch tab</dd><dt><kbd>⏎</kbd></dt><dd>Go to active search result</dd><dt><kbd>+</kbd></dt><dd>Expand all sections</dd><dt><kbd>-</kbd></dt><dd>Collapse all sections</dd></dl></div><div class="infos"><h2>Search Tricks</h2><p>Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to restrict the search to a given type.</p><p>Accepted types are: <code>fn</code>, <code>mod</code>, <code>struct</code>, <code>enum</code>, <code>trait</code>, <code>type</code>, <code>macro</code>, and <code>const</code>.</p><p>Search functions by type signature (e.g., <code>vec -> usize</code> or <code>* -> vec</code>)</p><p>Search multiple things at once by splitting your query with comma (e.g., <code>str,u8</code> or <code>String,struct:Vec,test</code>)</p></div></div></aside><script>window.rootPath = "../";window.currentCrate = "queue";</script><script src="../aliases-20190820-1.39.0-nightly-bea0372a1.js"></script><script src="/main-20190820-1.39.0-nightly-bea0372a1.js"></script><script defer="" src="../search-index-20190820-1.39.0-nightly-bea0372a1.js"></script> | ||
</div> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
(function(){function changeSetting(settingName,isEnabled){updateLocalStorage('rustdoc-'+settingName,isEnabled)}function getSettingValue(settingName){return getCurrentValue('rustdoc-'+settingName)}function setEvents(){var elems=document.getElementsByClassName("slider");if(!elems||elems.length===0){return}for(var i=0;i<elems.length;++i){var toggle=elems[i].previousElementSibling;var settingId=toggle.id;var settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=function(){changeSetting(this.id,this.checked)}}}setEvents()})() | ||
pietroalbini marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.