32 lines
1.1 KiB
Bash
Executable File
32 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
## Reconnect Discourse container to external networks after rebuild
|
|
## Run after every: ./launcher rebuild app
|
|
##
|
|
## The official launcher creates a NEW container on rebuild, which loses
|
|
## the external network connections. This script reconnects them and
|
|
## restarts Traefik to pick up the new routing.
|
|
|
|
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 to traefik-public." || \
|
|
echo " Already connected to traefik-public."
|
|
|
|
echo "Connecting Discourse container to mailcow network..."
|
|
docker network connect mailcowdockerized_mailcow-network "$CONTAINER_ID" 2>/dev/null && \
|
|
echo " Connected to mailcow network." || \
|
|
echo " Already connected to mailcow network."
|
|
|
|
echo "Restarting Traefik to pick up new container routing..."
|
|
docker restart traefik
|
|
echo " Traefik restarted."
|
|
|
|
echo ""
|
|
echo "Done. Forum should be accessible in a few seconds."
|