Skip to content

Commit 9585ac6

Browse files
committed
Improve instructions for getting started
- Change default command so that users don't try to build all of crates.io - Don't mislead users to think that `docker-compose up` will rebuild the site - Add instructions for building a sample crate - Document when and where the server will be ready to access
1 parent 5adb35e commit 9585ac6

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ COPY docker-entrypoint.sh /opt/docsrs/entrypoint.sh
7474

7575
WORKDIR /opt/docsrs
7676
ENTRYPOINT ["/opt/docsrs/entrypoint.sh"]
77-
CMD ["daemon", "--foreground"]
77+
CMD ["start-web-server"]

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,20 @@ Make sure you have docker-compose and are able to download ~10GB data on the fir
6161
git clone https://github.com/rust-lang/docs.rs.git docs.rs
6262
cd docs.rs
6363
cp .env.sample .env
64-
docker-compose up # This may take a half hour or more on the first run
64+
65+
docker-compose build # This builds the docs.rs binary
66+
67+
# Build a sample crate to make sure it works
68+
# This sets up the docs.rs build environment, including installing the nightly
69+
# Rust toolchain. This will take a while the first time but will be cached afterwards.
70+
docker-compose run web build crate regex 1.3.1
71+
72+
# This starts the web server but does not build any crates.
73+
# If you want to build crates, see below under `build` subcommand
74+
docker-compose up
75+
76+
# As soon as you see `cratesfyi "$@"`
77+
# you should be able to navigate to http://localhost:3000
6578
```
6679

6780
If you need to store big files in the repository's directory it's recommended to

0 commit comments

Comments
 (0)