From 0e33e8dbc897e5546ed70106a91de0b87674042e Mon Sep 17 00:00:00 2001 From: Sidney Marvin Fricke Date: Thu, 25 Jun 2026 08:39:23 +0200 Subject: [PATCH] extract startup logic into server/startup.sh for easy customization Replaces the inline bash -c "..." command in docker-compose with a dedicated startup.sh script that installs system packages, pip deps, and starts the server. Add custom setup steps (apt, pip, curl, etc.) in the marked section. --- docker-compose.yml | 7 +------ server/startup.sh | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 server/startup.sh diff --git a/docker-compose.yml b/docker-compose.yml index e38992f..325e6df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,12 +4,7 @@ services: container_name: mcp-bash restart: unless-stopped working_dir: /workspace - command: | - bash -c " - apt-get update -qq && - apt-get install -y --no-install-recommends curl wget git vim nano htop procps jq less unzip && - pip install -q -r /app/requirements.txt && - cd /app && python -u main.py" + command: bash /app/startup.sh ports: - "8000:8000" volumes: diff --git a/server/startup.sh b/server/startup.sh new file mode 100644 index 0000000..45e6a3d --- /dev/null +++ b/server/startup.sh @@ -0,0 +1,19 @@ +#!/bin/bash +set -e + +# ─── System packages ────────────────────────────────────────────────────────── +apt-get update -qq +apt-get install -y --no-install-recommends \ + curl wget git vim nano htop procps jq less unzip + +# ─── Python dependencies ────────────────────────────────────────────────────── +pip install -q -r /app/requirements.txt + +# ─── Custom setup (add your own steps below) ────────────────────────────────── +# Example: +# apt-get install -y --no-install-recommends nodejs npm +# pip install -q pandas numpy +# curl -fsSL https://example.com/tool | bash + +# ─── Start server ───────────────────────────────────────────────────────────── +exec python -u /app/main.py