README.md 1.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Aurweb and Docker

The `INSTALL` document details a manual Aurweb setup, but Docker images are also
provided here to avoid the complications of database configuration (and so
forth).

### Setup

Naturally, both `docker` and `docker-compose` must be installed, and your Docker
service must be started:

```sh
systemctl start docker.service
```

The main image - `aurweb` - must be built manually:

```sh
19
docker compose build
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
```

### Starting and Stopping the Services

With the above steps complete, you can bring up an initial cluster:

```sh
docker compose up
```

Subsequent runs will be done with `start` instead of `up`. The cluster can be
stopped with `docker compose stop`.

### Testing

With a running cluster, execute the following in a new terminal:

```sh
docker compose run test
```
40

41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
### Generating Dummy Data

Before you can make meaningful queries to the cluster, it needs some data.
Luckily such data can be generated. First, `docker ps` to discover the ID of the
container running the FastAPI. Then:

```sh
docker exec -it <id> /bin/bash
./scheme/gendummydata.py dummy.sql
mysql aurweb < dummy.sql
```

The generation script may prompt you to install other Arch packages before it
can proceed.

56
57
58
59
60
61
62
63
64
65
### Querying the RPC

The Fast (Python) API runs on Port 8444, while the legacy PHP version runs
on 8443. You can query one like so:

```sh
curl -k "https://localhost:8444/rpc/?v=5&type=search&arg=python"
```

`-k` bypasses local certificate issues that `curl` will otherwise complain about.