Docker Compose
Self-hosting with docker-compose.
Prerequisites
Install git, zip
Instructions for Linux OSes:
sudo yum install -y git zip yum-utils
# Install and setup Docker for non-root user
yes | sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yes | sudo yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo systemctl enable --now docker
sudo usermod -aG docker $USER
newgrp docker
# Install Deno
curl -fsSL https://deno.land/install.sh > /tmp/install.sh
chmod +x /tmp/install.sh
sudo env DENO_INSTALL=/usr/local /tmp/install.sh
rm /tmp/install.shSelf-hosting with Docker Compose
Download source code
Clone the code using git:
git clone https://github.com/space-operator/flow-backendGo to docker folder:
cd flow-backend/dockerEvery commands in this tutorial must be run in flow-backend/docker folder.
Generate secrets and configurations
Our Docker Compose setup needs 2 configuration files, both are located in flow-backend/docker folder:
.env: dotenv file containing environment variables.config.toml: configuration file used by flow-server.
Template for these files are in env.example and flow-server-config.toml .
Generate secrets and config files for your server:
./gen-secrets.tsGenerated secrets are saved in .env and .config.toml files.
The script use env.example and flow-server-config.toml as templates, you can edit them before running the script to customize values.
Start and wait for containers to be ready:
docker compose up -d --waitPort binding:
Supabase: port 8000
Flow server: port 8080
PostgreSQL: port 5432
To see Supabase Dashboard:
Open
.envfile to seeDASHBOARD_USERNAMEandDASHBOARD_PASSWORDvalues:
cat .env | grep DASHBOARDVisit http://localhost:8000/ .
Export your data and use them in self-hosted server
Follow steps from here
Stop and clean up
To stop services:
docker compose downStop and clean up all data:
docker compose down -vLast updated
Was this helpful?