Skip to content

Commit 102223d

Browse files
authored
Update genapkovl-docker.sh
1 parent d609413 commit 102223d

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

genapkovl-docker.sh

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,36 @@ mkdir -p "$tmp"/usr/bin
8484
makefile root:root 0755 "$tmp"/usr/bin/alpdock-run-compose <<EOF
8585
#!/bin/sh
8686
87-
wget https://github.com/vanderstack/vanderstack-docker-server/raw/main/docker-compose.yml
88-
docker-compose up -d
87+
# Variables
88+
COMPOSE_URL="https://github.com/vanderstack/vanderstack-docker-server/raw/main/docker-compose.yml"
89+
COMPOSE_DIR="/var/docker"
90+
91+
# Ensure Docker is running
92+
echo "Waiting for Docker to start..."
93+
while ! docker info >/dev/null 2>&1; do
94+
sleep 2
95+
done
96+
echo "Docker is running."
97+
98+
# Create directory for docker-compose file
99+
mkdir -p "$COMPOSE_DIR"
100+
cd "$COMPOSE_DIR" || exit 1
101+
102+
# Download the docker-compose.yml file
103+
echo "Downloading docker-compose.yml..."
104+
if ! wget -O docker-compose.yml "$COMPOSE_URL"; then
105+
echo "Error: Failed to download docker-compose.yml from $COMPOSE_URL."
106+
exit 1
107+
fi
108+
109+
# Start services with docker-compose
110+
echo "Starting services with docker-compose..."
111+
if ! docker-compose up -d; then
112+
echo "Error: Failed to start services with docker-compose."
113+
exit 1
114+
fi
115+
116+
echo "Services started successfully."
89117
EOF
90118

91119
rc_add devfs sysinit

0 commit comments

Comments
 (0)