You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CRAWLER_GITHUB_TOKEN="<Your GitHub Personal Access Token>"
129
+
CRAWLER_API_URL="http://crawler:5000"
130
+
CRAWLER_GITHUB_TOKEN="<your GitHub token>"
131
+
CRAWLER_DEADLETTER_PROVIDER=cd(file)
132
+
CRAWLER_NAME=cdcrawlerlocal
133
+
CRAWLER_QUEUE_PROVIDER=memory
134
+
CRAWLER_STORE_PROVIDER=cd(file)
127
135
```
128
136
129
137
Now, from withing your **docker_dev_env_experiment** directory, run:
@@ -214,8 +222,99 @@ The database contains two collections:
214
222
215
223
The reason the definitions database is called definitions-paged is because, previously, the definitions collection was not paged. The pagination was added in [this January 2019 pull request](https://github.com/clearlydefined/service/pull/364). Our production Azure setup includes both definitions and definitions-paged collections - the definitions-paged collection is the one that is actively used. This development environment includes the definitions-paged collection in order to more closely mirror production.
216
224
217
-
These collections are seeded using the following container.
225
+
These collections are seeded using the Clearly Defined Mongo Seed container.
226
+
227
+
If you have [mongodb](https://docs.mongodb.com/manual/installation/) installed on your local system, you can attach to the Mongo database with:
228
+
229
+
```bash
230
+
$ mongo mongodb://localhost:27017
231
+
```
232
+
233
+
You can also do this through the [Docker desktop client](https://www.docker.com/products/docker-desktop).
234
+
218
235
219
236
### Clearly Defined Mongo Seed
220
237
221
-
This container exists only to seed initial data into the Clearly Defined Mongo DB. It populates both the collections and definitions-paged collections with sample data.
238
+
This container exists only to seed initial data into the Clearly Defined Mongo DB. It populates both the collections and definitions-paged collections with sample data.
239
+
240
+
## Using
241
+
242
+
As noted above, you can start all of the containers with:
243
+
244
+
```bash
245
+
$ docker-compose up
246
+
```
247
+
248
+
This will show all of the logs from all of the container in your current shell.
249
+
250
+
### Rebuilding after changes
251
+
252
+
When you make changes to one of the code bases, you do need to rebuild the Docker images.
253
+
254
+
If you were to make a change to the website, and want to rebuild only that container, you can do so by running:
255
+
256
+
```bash
257
+
$ docker-compose up --detach --build web
258
+
```
259
+
260
+
The same will work for the service and the crawler:
261
+
262
+
```bash
263
+
$ docker-compose up --detach --build service
264
+
```
265
+
266
+
```bash
267
+
$ docker-compose up --detach --build crawler
268
+
```
269
+
270
+
### Stopping containers
271
+
272
+
You can stop and destroy the containers in the shell where you ran `docker-compose up` with CTRL c.
273
+
274
+
You can also do this through the [Docker desktop client](https://www.docker.com/products/docker-desktop) or through the [Docker CLI](https://docs.docker.com/engine/reference/commandline/cli/).
275
+
276
+
Note that in order to re-seed the database you must completely destroy the containers (this can also be done through both the Desktop client and the CLI).
277
+
278
+
### Attaching to a container
279
+
280
+
You can attach to a container either through using the [Docker desktop client](https://www.docker.com/products/docker-desktop) or the [Docker CLI](https://docs.docker.com/engine/reference/commandline/attach/).
281
+
282
+
### Running only certain containers
283
+
284
+
You can choose to run or not run any of the containers listed in [docker-compose.yml]. If you don't wish to run one of the containers, comment it out like this:
285
+
286
+
**docker-compose.yml**
287
+
```bash
288
+
version: "3.8"
289
+
services:
290
+
# web:
291
+
# build:
292
+
# context: <path-to-website-repo-on-your-system>
293
+
# dockerfile: DevDockerfile
294
+
# ports:
295
+
# - "3000:3000"
296
+
# stdin_open: true
297
+
service:
298
+
build:
299
+
context: <path-to-service-repo-on-your-system>
300
+
dockerfile: DevDockerfile
301
+
ports:
302
+
- "4000:4000"
303
+
env_file: .env
304
+
volumes:
305
+
- ./harvested_data:/tmp/harvested_data/
306
+
links:
307
+
- clearlydefined_mongo_db
308
+
- crawler
309
+
crawler:
310
+
build:
311
+
context: <path-to-crawler-repo-on-your-system>
312
+
dockerfile: DevDockerfile
313
+
env_file: .env
314
+
volumes:
315
+
- ./harvested_data:/tmp/harvested_data/
316
+
ports:
317
+
- "5000:5000"
318
+
```
319
+
320
+
If you run `docker-compose up` after making these changes to the file, it will start all containers except the web container.
0 commit comments