2024-02-21 15:41:38 +08:00
#!/usr/bin/env bash
2021-06-14 21:50:13 +08:00
set -eu
2021-01-22 00:06:32 +08:00
2023-08-28 22:43:03 +08:00
# Listmonk demo setup using `docker compose`.
2021-01-22 00:06:32 +08:00
# See https://listmonk.app/docs/installation/ for detailed installation steps.
2021-06-14 21:50:13 +08:00
check_dependencies( ) {
2021-01-22 00:06:32 +08:00
if ! command -v curl > /dev/null; then
echo "curl is not installed."
exit 1
2021-08-28 21:43:51 +08:00
fi
2021-01-22 00:06:32 +08:00
if ! command -v docker > /dev/null; then
echo "docker is not installed."
exit 1
2021-08-28 21:43:51 +08:00
fi
2021-01-22 00:06:32 +08:00
2023-08-28 22:43:03 +08:00
# Check for "docker compose" functionality.
if ! docker compose version > /dev/null 2>& 1; then
echo "'docker compose' functionality is not available. Please update to a newer version of Docker. See https://docs.docker.com/engine/install/ for more details."
2021-01-22 00:06:32 +08:00
exit 1
fi
}
setup_containers( ) {
2021-08-28 21:43:51 +08:00
curl -o docker-compose.yml https://raw.githubusercontent.com/knadh/listmonk/master/docker-compose.yml
2023-08-28 22:43:03 +08:00
# Use "docker compose" instead of "docker-compose"
docker compose up -d demo-db demo-app
2021-01-22 00:06:32 +08:00
}
show_output( ) {
2021-08-28 21:43:51 +08:00
echo -e "\nListmonk is now up and running. Visit http://localhost:9000 in your browser.\n"
2021-01-22 00:06:32 +08:00
}
2021-06-14 21:50:13 +08:00
check_dependencies
2021-01-22 00:06:32 +08:00
setup_containers
show_output