|
| 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