🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.
Update Docker Compose configuration and scripts for webserver support (#638)
Bill Yang493dc2657483
diff --git a/docker-compose.yml b/docker-compose.ymlindex 629691487..cacb6116a 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -1,5 +1,6 @@services:caddy:+ profiles: ["with-webserver"]image: caddy:2.10.0container_name: caddyrestart: unless-stoppeddiff --git a/docs/content/docs/self-hosting.mdx b/docs/content/docs/self-hosting.mdxindex 9f11ecbd5..eeb5adff2 100644--- a/docs/content/docs/self-hosting.mdx+++ b/docs/content/docs/self-hosting.mdx@@ -114,27 +114,48 @@ Create your admin account. You can then log in and start adding your websites!## Managing Your Installation-Rybbit comes with several helper scripts to manage your installation:+### Helper Scripts-- **start.sh**: Start all services after they've been stopped+Rybbit comes with helper scripts to manage your installation:++- **restart.sh**: Restart all services (useful when you've changed .env settings)```bash- ./start.sh+ ./restart.sh```-- **stop.sh**: Stop all running services+- **update.sh**: Update to the latest version by pulling new code and rebuilding containers```bash- ./stop.sh+ git pull+ ./update.sh```-- **restart.sh**: Restart all services+### Docker Compose Commands++You can also manage services directly with Docker Compose:++- **Stop all services**:```bash- ./restart.sh+ docker compose stop```-- **update.sh**: Update to the latest version by pulling new code and rebuilding containers+- **Stop and remove containers** (preserves data):```bash- git pull- ./update.sh+ docker compose down+ ```++- **Start services** (if you used setup.sh with default webserver):+ ```bash+ docker compose --profile with-webserver up -d+ ```++- **Start services** (if you used setup.sh with --no-webserver):+ ```bash+ docker compose up -d+ ```++- **View logs**:+ ```bash+ docker compose logs -f```<Callout>diff --git a/restart.sh b/restart.shindex 69bff0852..670bf3bb9 100644--- a/restart.sh+++ b/restart.sh@@ -21,10 +21,10 @@ source .env# Start the appropriate services with updated environment variablesif [ "$USE_WEBSERVER" = "false" ]; then# Start without the caddy service when using --no-webserver- docker compose up -d backend client clickhouse postgres --force-recreate+ docker compose up -d --force-recreateelse# Start all services including caddy- docker compose up -d --force-recreate+ docker compose --profile with-webserver up -d --force-recreatefiecho "Services restarted. You can monitor logs with: docker compose logs -f"\ No newline at end of filediff --git a/setup.sh b/setup.shindex 00b429570..61b5eb033 100644--- a/setup.sh+++ b/setup.sh@@ -154,10 +154,10 @@ fiecho "Building and starting Docker services..."if [ "$USE_WEBSERVER" = "false" ]; then# Start without the caddy service when using --no-webserver- docker compose up -d backend client clickhouse postgres+ docker compose up -delse# Start all services including caddy- docker compose up -d+ docker compose --profile with-webserver up -dfiecho "Setup complete. Services are starting in the background."diff --git a/start.sh b/start.shdeleted file mode 100644index b21a23400..000000000--- a/start.sh+++ /dev/null@@ -1,26 +0,0 @@-#!/bin/bash--# Exit immediately if a command exits with a non-zero status.-set -e--echo "Starting services..."--# Check if .env file exists-if [ ! -f .env ]; then- echo "Error: .env file not found. Please run setup.sh first."- echo "Usage: ./setup.sh <domain_name>"- exit 1-fi--# Load environment variables-source .env--if [ "$USE_WEBSERVER" = "false" ]; then- # Start without the caddy service when using --no-webserver- docker compose start backend client clickhouse postgres-else- # Start all services including caddy- docker compose start-fi--echo "Services started. You can monitor logs with: docker compose logs -f"\ No newline at end of filediff --git a/stop.sh b/stop.shdeleted file mode 100644index 21c68b78b..000000000--- a/stop.sh+++ /dev/null@@ -1,9 +0,0 @@-#!/bin/bash--# Exit immediately if a command exits with a non-zero status.-set -e--echo "Stopping services..."-docker compose stop--echo "Services stopped."\ No newline at end of filediff --git a/update.sh b/update.shindex d6f2d9385..0e548385a 100644--- a/update.sh+++ b/update.sh@@ -36,10 +36,10 @@ source .envif [ "$USE_WEBSERVER" = "false" ]; then# Start without the caddy service when using --no-webserver- docker compose up -d backend client clickhouse postgres --force-recreate+ docker compose up -d --force-recreateelse# Start all services including caddy- docker compose up -d --force-recreate+ docker compose --profile with-webserver up -d --force-recreatefiecho "Update complete. Services are running with the latest version."