Skip to content

Commit 07e72b4

Browse files
feat: add ability to self host with a different postgres & redis instance (#423)
1 parent ca71c6a commit 07e72b4

File tree

3 files changed

+62
-0
lines changed

3 files changed

+62
-0
lines changed

docker-compose.yml

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ services:
3030
context: "./"
3131
args:
3232
PGSQL_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DATABASE}
33+
image: revertengg/revert-db-seed
3334
depends_on:
3435
- db
3536
profiles: [ "tools" ]

fern/docs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ navigation:
4848
contents:
4949
- page: Developer Guide
5050
path: ./docs/contents/developer-guides.mdx
51+
- page: Self Host Revert
52+
path: ./docs/contents/docker-compose.mdx
5153
- section: CRM Support
5254
contents:
5355
- page: CRM Support

fern/docs/contents/docker-compose.mdx

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#### Spinning up Revert with docker-compose locally
2+
3+
The easiest way to start with self-hosted Revert is to run it via docker-compose:
4+
5+
```shell
6+
# Get the code
7+
git clone --depth 1 https://github.com/revertinc/revert
8+
9+
# Copy the example env file
10+
cd revert
11+
cp .env.example .env
12+
cp packages/backend/.env.example packages/backend/.env
13+
cp packages/client/.env.example packages/client/.env
14+
cp packages/js/.env.example packages/js/.env
15+
cp packages/react/.env.example packages/react/.env
16+
cp packages/vue/.env.example packages/vue/.env
17+
18+
# Ensure that clerk is setup in `client` and a user is created by following the instructions here: https://docs.revert.dev/overview/developer-guide/developer-guide#-revertdotdev-client
19+
20+
# Update these .env files with any of your own secrets if you'd like to.
21+
22+
# Then In the root directory run
23+
24+
# When running for the first time to seed the database. (RUN ONLY ONCE)
25+
docker-compose run db-seed
26+
27+
# For subsequent runs
28+
docker-compose up -d
29+
30+
```
31+
32+
The UI is now available at http://localhost:3000 and the backend is available at http://localhost:4001. This also contains a postgres database alongside the API.
33+
34+
35+
#### Run Revert with your own database & redis
36+
37+
The above steps allow you to spin up a postgres & redis instance alongside the API and UI.
38+
39+
To use your own postgres & redis instance run the following set of commands:
40+
41+
42+
```shell
43+
44+
# Seed the database
45+
46+
docker run \
47+
-e PGSQL_URL=postgresql://<PG_USER>:<PG_PASSWORD>@<PG_HOST>:<PG_PORT>/<PG_DB> \
48+
revertengg/revert-db-seed:latest
49+
50+
# To run Revert API:
51+
52+
docker run \
53+
-v cache:/data \
54+
-v pgdata:/var/lib/postgresql/data \
55+
-e PGSQL_URL=postgresql://<PG_USER>:<PG_PASSWORD>@<PG_HOST>:<PG_PORT>/<PG_DB> \
56+
-e REDIS_SERVER_URL=redis://<REDIS_USER>:<REDIS_PASSWORD>@<REDIS_HOST>:<REDIS_PORT> \
57+
revertengg/revert-api-ce:latest
58+
59+
```

0 commit comments

Comments
 (0)