cadcad-discourse-forum/scripts/post-rebuild.sh

19 lines
653 B
Bash
Executable File

#!/bin/bash
## Reconnect Discourse container to traefik-public network after rebuild
## Run after every: ./launcher rebuild app
##
## The official launcher creates a NEW container on rebuild, which loses
## the external network connection. This script reconnects it.
CONTAINER_ID=$(docker ps -q -f name=app)
if [ -z "$CONTAINER_ID" ]; then
echo "ERROR: Discourse container not running. Start it first: ./launcher start app"
exit 1
fi
echo "Connecting Discourse container to traefik-public network..."
docker network connect traefik-public "$CONTAINER_ID" 2>/dev/null && \
echo "Connected successfully." || \
echo "Already connected."