Docker Compose setup
Clone the repository (opens in a new tab)
git clone https://github.com/ritual-net/infernet-cloud
For easier file navigation, follow these instructions in your IDE by opening README.md (opens in a new tab).
Install Docker Compose (opens in a new tab)
Alternatively, you may install an equivalent GUI — Docker Desktop (opens in a new tab), OrbStack (opens in a new tab), Podman (opens in a new tab), etc.
Install pnpm (opens in a new tab)
Initialize the Docker Compose setup
pnpm init:docker
This script will:
- Create an
.env.docker
file with default values copied from.env.docker.example
(opens in a new tab), if one doesn't already exist. - Install package dependencies from npm.
- Intialize Docker volume for
edgedb
service at./edgedb-data/
(opens in a new tab), apply default EdgeDB Auth config, and perform schema migrations.
Configure environment variables
- Open
.env.docker
in a text editor and adjust the following environment variables:SERVER_HOST
: The public-facing URL of your Infernet Cloud server (defaulthttp://localhost:3000
(opens in a new tab) when running locally).EDGEDB_SERVER_PASSWORD
: The admin password for the EdgeDB database.SENDGRID_KEY
(optional): A SendGrid API Key (opens in a new tab) used to authenticate the SendGrid email relay service.- To use a different email relay service, modify the environment variables found at
docker-compose.yml
(opens in a new tab) ›services
›smtp
›environment
.
- To use a different email relay service, modify the environment variables found at
- Save
.env.docker
.
Configure EdgeDB Auth (opens in a new tab)
-
Open
dbschema/bootstrap/auth.edgeql
(opens in a new tab) in a text editor.- Set
ext::auth::AuthConfig::allowed_redirect_urls
to the public-facing URL of your Infernet Cloud server (matching theSERVER_HOST
environment variable from above). - Set
ext::auth::AuthConfig::auth_signing_key
to a unique high-entropy value. - Set
ext::auth::SMTPConfig::sender
to the email address to send verification emails from. Configure the other SMTP configuration values according to your email relay service as needed. - Under
ext::auth::EmailPasswordProviderConfig
, setrequire_verification
totrue
to require new accounts to verify their email address before logging in; otherwise set it tofalse
.
- Set
-
Apply changes to EdgeDB Auth settings:
pnpm docker:edgedb:init:auth
For more information, see the EdgeDB Auth documentation (opens in a new tab).
Configure the reverse proxy
- Open
caddy/Caddyfile
(opens in a new tab) in a text editor.- Replace
localhost:3000
with the public-facing domain of your Infernet Cloud server (matching theSERVER_HOST
environment variable from above, withhttp://
orhttps://
omitted).
- Replace
- Save
caddy/Caddyfile
(opens in a new tab). - If hosting Infernet Cloud on a cloud provider with a public-facing URL, ensure the corresponding port (default
3000
) is forwarded and whitelisted in your cloud provider's firewall settings.
For more information, see the Caddyfile documentation (opens in a new tab).
Start all services
pnpm docker:start
Docker images for all services will be installed from Docker Hub on first run.
List of services
-
caddy
– reverse proxy (opens in a new tab)- First run: generates a self-signed SSL certificate using Let's Encrypt (opens in a new tab).
-
server
– Node.js web server (opens in a new tab)- First run: installs npm package dependencies and builds Node.js production server using SvelteKit (opens in a new tab)
-
smtp
– email relay service (used for sending user verification emails) -
edgedb
– EdgeDB (opens in a new tab) database- First run: initializes Docker volume at
./edgedb-data/
(opens in a new tab), configures EdgeDB Auth, and performs schema migrations. - IMPORTANT: Keep the contents of the
./edgedb-data/
directory safe. If you modify/delete it, you will lose data stored in the database!
- First run: initializes Docker volume at
Access the Infernet Cloud UI
-
Open a web browser and navigate to
http://localhost:3000
(opens in a new tab) (or the public URL of your server defined in theSERVER_HOST
environment variable). -
If you're having trouble, double-check that the following values match:
- The
SERVER_HOST
environment variable in.env.docker
- The value of
ext::auth::AuthConfig::allowed_redirect_urls
indbschema/bootstrap/auth.edgeql
(opens in a new tab) - The domain name in
caddy/Caddyfile
(opens in a new tab) (withhttp://
orhttps://
omitted)
- The
-
Jump to Using Infernet Cloud to get started with deploying an Infernet Node.
Stop all services
pnpm docker:stop
Development scripts
Docker Compose
-
Run the Docker Compose CLI with the
.env.docker
environment variables applied:pnpm docker-compose
-
Start all Docker services in detached mode and display logs (wraps
docker compose up
command):pnpm docker:start
-
Rebuild Docker images without cache, then (re)start all services:
pnpm docker:start:force
-
Stop and remove all Docker services (wraps
docker compose down
command):pnpm docker:stop
-
Remove unused Docker data (images, containers, networks, and volumes):
pnpm docker:clean
server
service
-
Rebuild and restart
server
service after making changes to SvelteKit backend or frontend:pnpm docker:server:restart
edgedb
service
-
Restart
edgedb
service and migrate the database after making changes to EdgeDB schema / migrations:pnpm docker:edgedb:restart
-
Create a timestamped backup of the EdgeDB Docker volume (
./edgedb-data/
(opens in a new tab)):pnpm docker:edgedb:backup
-
Permanently delete the current EdgeDB Docker volume (
./edgedb-data/
(opens in a new tab)) after confirmation:pnpm docker:edgedb:destroy
-
Open an EdgeDB CLI (opens in a new tab) session from inside the
edgedb
Docker container:pnpm docker:edgedb:cli
Find more commands and their definitions in the scripts
section of package.json
(opens in a new tab).