Skip to content

Instantly share code, notes, and snippets.

@dastanaron
Created May 2, 2025 15:02
Show Gist options
  • Save dastanaron/3be3cc2b1b58351b32407905ac241790 to your computer and use it in GitHub Desktop.
Save dastanaron/3be3cc2b1b58351b32407905ac241790 to your computer and use it in GitHub Desktop.
Start FocalBoard
#!/bin/bash
CONTAINER_NAME="focalboard"
# Check if container exists
if docker container inspect "$CONTAINER_NAME" > /dev/null 2>&1; then
# Check if container is running
if [ "$(docker inspect -f '{{.State.Running}}' "$CONTAINER_NAME")" = "true" ]; then
echo "Stopping container $CONTAINER_NAME..."
docker stop "$CONTAINER_NAME"
echo "Container successfully stopped"
else
echo "Starting existing container $CONTAINER_NAME..."
docker start "$CONTAINER_NAME"
echo "Container successfully started"
fi
else
echo "Creating and starting new container $CONTAINER_NAME..."
docker run -d --name "$CONTAINER_NAME" -p 8080:8000 mattermost/focalboard
echo "Container successfully created and started"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment