commit 1155ef4a035332316b1d7f3baa445bcebcde90ac Author: Amir Gumerov Date: Sat Sep 5 12:29:34 2026 +0300 initial commit diff --git a/add_service.sh b/add_service.sh new file mode 100644 index 0000000..110cdbc --- /dev/null +++ b/add_service.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ "$#" -ne 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +SERVICE_NAME=$1 +TEMPLATE="service.template" +TARGET="compose.yaml" + +if [ ! -f "$TEMPLATE" ]; then + echo "Error: Template file '$TEMPLATE' not found!" + exit 1 +fi + +if [ ! -f "$TARGET" ]; then + echo "Error: Target file '$TARGET' not found!" + exit 1 +fi + +sed -e "s/{{SERVICE_NAME}}/$SERVICE_NAME/g" "$TEMPLATE" >> "$TARGET" + +echo "Service '$SERVICE_NAME' successfully added to $TARGET" + +docker compose create $SERVICE_NAME +docker compose start $SERVICE_NAME + +echo "docker container created and started" diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..0baad47 --- /dev/null +++ b/compose.yaml @@ -0,0 +1 @@ +services: diff --git a/service.template b/service.template new file mode 100644 index 0000000..0165577 --- /dev/null +++ b/service.template @@ -0,0 +1,5 @@ + {{SERVICE_NAME}}: + image: ghcr.io/gumerov-amir/ttregbot-docker + volumes: + - /opt/ttregbot/{{SERVICE_NAME}}:/data + restart: unless-stopped