@@ -49,8 +49,9 @@ Example badges for `mio` crate:
49
49
50
50
## Development
51
51
52
- We strongly recommend using docker-compose, which will make it easier to get started
53
- without adding new users and packages to your host machine.
52
+ We strongly recommend using [ docker-compose] ( https://docs.docker.com/compose/ ) ,
53
+ which will make it easier to get started without adding new users and packages
54
+ to your host machine.
54
55
55
56
### Getting started
56
57
@@ -60,7 +61,19 @@ Make sure you have docker-compose and are able to download ~10GB data on the fir
60
61
git clone https://github.com/rust-lang/docs.rs.git docs.rs
61
62
cd docs.rs
62
63
cp .env.sample .env
63
- 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
+ # It should print a link to the website once it finishes initializing.
75
+ docker-compose up
76
+
64
77
```
65
78
66
79
If you need to store big files in the repository's directory it's recommended to
@@ -91,7 +104,7 @@ This is probably because you have `git.autocrlf` set to true,
91
104
``` sh
92
105
# This command will start web interface of docs.rs and you can access it from
93
106
# http://localhost:3000/`
94
- docker-compose run -p 3000:3000 web start-web-server
107
+ docker-compose up
95
108
```
96
109
97
110
#### ` build ` subcommand
@@ -126,15 +139,24 @@ docker-compose run web database add-directory <DIRECTORY> [PREFIX]
126
139
docker-compose run web database update-github-fields
127
140
```
128
141
129
- If you want to explore or edit database manually, you can connect database
130
- with ` psql ` command.
142
+ If you want to explore or edit database manually, you can connect to the database
143
+ with the ` psql ` command.
131
144
132
145
``` sh
133
146
# this will print the name of the container it starts
134
147
docker-compose run -d db
135
148
docker exec -it < the container name goes here> psql -U cratesfyi
136
149
```
137
150
151
+ #### ` daemon ` subcommand
152
+
153
+ ``` sh
154
+ # Run a persistent daemon which queues builds and starts a web server.
155
+ # Warning: This will try to queue hundreds of packages on crates.io, only start it
156
+ # if you have enough resources!
157
+ docker-compose run -p 3000:3000 web daemon --foreground
158
+ ```
159
+
138
160
### Contact
139
161
140
162
Docs.rs is run and maintained by [ Rustdoc team] ( https://www.rust-lang.org/governance/teams/dev-tools#rustdoc ) .
0 commit comments