Introducing Docker Support ⚓️

Introducing Docker Support ⚓️
Revert now supports Docker


Today we are launching official support for Docker. Now, you no longer have to build Revert from source. You may directly use the officially supported Docker images to self host Revert in your own infrastructure.

Why?
We believe developer experience is of paramount for what we’re building and want to make it as easy as possible for a developer to use Revert on the Cloud or on their own infra.

You can use the docker images that come with a postgres instance of its own or use your own postgres database.

How to spin up Revert with docker-compose locally

The way to start with self-hosted Revert till now was to run it via docker-compose locally:


# Get the code
git clone --depth 1 https://github.com/revertinc/revert

# Copy the example env file

cd revert
cp .env.example .env
cp packages/backend/.env.example packages/backend/.env
cp packages/client/.env.example packages/client/.env
cp packages/js/.env.example packages/js/.env
cp packages/react/.env.example packages/react/.env
cp packages/vue/.env.example packages/vue/.env

# 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

# Update these .env files with any of your own secrets if you'd like to.

# Then In the root directory run
# When running for the first time to seed the database. (RUN ONLY ONCE)

docker-compose run db-seed

# For subsequent runs

docker-compose up -d

The UI is available at http://localhost:3000 and the backend is available at http://localhost:4001. This also contains a postgres database alongside the API.


The above steps allow you to spin up a postgres & redis instance alongside the API and UI.

Run Revert with your own database & redis

While this is great, oftentimes you’d like to use your own instance of postgres and cache. To use your own postgres & redis instance run the following set of commands:

# Seed the database

docker run \
-e PGSQL_URL=postgresql://<PG_USER>:<PG_PASSWORD>@<PG_HOST>:<PG_PORT>/<PG_DB> \
docker.revert.dev/revertengg/revert-db-seed:latest

# To run Revert API:

docker run \
-v cache:/data \
-v pgdata:/var/lib/postgresql/data \
-e PGSQL_URL=postgresql://<PG_USER>:<PG_PASSWORD>@<PG_HOST>:<PG_PORT>/<PG_DB> \
-e REDIS_SERVER_URL=redis://<REDIS_USER>:<REDIS_PASSWORD>@<REDIS_HOST>:<REDIS_PORT> \
docker.revert.dev/revertengg/revert-api-ce:latest

These steps use the official docker images so you can skip the build step altogether!

We’d love to make self-hosting easier than ever.

Give it a spin and let us know if you have any feedback on how we can make the experience much more smoother!

We'll be actively keeping an eye on the GitHub discussions and will be responding to your feedback.