From 6313bc5ec7e7e7b62c1de9bc91adb0aafbb2761c Mon Sep 17 00:00:00 2001 From: Max Richter Date: Fri, 11 Jul 2025 10:26:51 +0200 Subject: [PATCH] docs: add section on dev services --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 2721b5f..52dc21e 100644 --- a/README.md +++ b/README.md @@ -116,21 +116,23 @@ docker compose exec step step ca provisioner update acme \ --x509-default-dur=2160h ``` -### Use the preconfigured services +### Create a shell script to start/stop general services -If you use the preconfigured services, you can add the following snippet to you `.bashrc`/`.zshrc` to easily start, stop, and manage the services. +I often use `dbgate` to interact with databases. For services like that i setup a `services/compose.yml` inside this directory where I define each service i use with a custom profile so that i can start and stop them individually. + +If you use the preconfigured services, you can add the following snippet to you `.bashrc`/`.zshrc` to easily start, stop, and manage the services. Make sure to update the `PROJECT_DIR` variable to point to the correct directory. ```shell dev () { PROJECT_DIR="$HOME/Projects/dev/services" case "$1" in (start) shift - docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" up -d ;; + docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" up -d ;; (restart) shift - docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" restart ;; + docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" restart ;; (stop) shift - docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" down --remove-orphans ;; + docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" down --remove-orphans ;; (logs) shift - docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" logs -f ;; + docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" logs -f ;; (*) echo "Usage: dev {start|restart|stop|logs} [services...]" ;; esac }