Skip to content

Commit a620fc5

Browse files
committed
Add documentation
1 parent 801edf8 commit a620fc5

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

README.md

+33-1
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,19 @@ See below for detailed information on building & contributing to telescope.
4646
to register a new GitHub OAuth application or get a new client secret.
4747
You will also have to create a discord OAuth app and bot token. Instructions
4848
can be found in `config_example.toml`.
49+
50+
You must make sure that some of the items in the `.env` file match.
51+
For example, the database password in `POSTGRES_PASSWORD` needs to be the
52+
same as the one in `DATABASE_URL`. If you forget to do this, you will need
53+
to reset the database (`docker-compose down --volumes`).
4954
5055
5. Build and start the docker images.
5156
```shell
5257
docker-compose up -d
5358
```
5459
5560
6. Run the database migrations. Replace the "xx.." in the command with the admin
56-
secret from your `.env` file. Make sure the `admin-secret` is at least 32 characters long.
61+
secret from your `.env` file. **Make sure the `admin-secret` is at least 32 characters long.**
5762
```shell
5863
hasura --project rcos-data/ migrate --admin-secret xxxxxxxxxxxxxxxxxxxxxxxx --endpoint http://localhost:8000 apply
5964
```
@@ -77,6 +82,33 @@ See below for detailed information on building & contributing to telescope.
7782
docker-compose up --build -d
7883
```
7984

85+
### Running Telescope outside of Docker
86+
87+
Developing telescope with Docker is useful because you are testing Telescope in
88+
an almost identical environment to that which it runs on in production. In order
89+
to improve compile speed, due to the incremental compilation cache of Rust, you
90+
may want to develop and run Telescope outside of Docker. You can do this by
91+
following these *optional* instructions:
92+
93+
1. Telescope typically uses the standard web port 80, but outside of Docker you
94+
will need to change that to 8080 by setting `address` to `0.0.0.0:8080` in
95+
`config.toml`. This is because port 80 is restricted.
96+
97+
2. On macOS, Docker runs within a virtual machine. That means that you need to
98+
change `Caddyfile.dev` to point to your computer outside the virtual machine.
99+
You only need to do this if you are using Docker Desktop on macOS.
100+
101+
```
102+
localhost:443 {
103+
encode zstd gzip
104+
reverse_proxy host.docker.internal:8080
105+
}
106+
```
107+
108+
3. The commands you use to run and test Telescope need to be changed. To start
109+
the supporting services like Hasura, Postgres, and Caddy, run `docker-compose
110+
-f docker-compose.dev.yml up -d`. To start Telescope, run `cargo run`.
111+
80112
## Development Notes
81113
These are note for Telescope Developers on how to find and update Telescope
82114
itself.

docker-compose.dev.yml

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
# Hasura Postgres -> GraphQL engine
1717
hasura:
1818
image: hasura/graphql-engine:v2.2.0
19+
restart: unless-stopped
1920
depends_on:
2021
- db
2122
environment:
@@ -45,6 +46,7 @@ volumes:
4546
db_data:
4647
caddy_data:
4748

49+
# We need to ensure a stable gateway ip if we want the caddyfile to point to the host each time
4850
networks:
4951
default:
5052
ipam:

0 commit comments

Comments
 (0)