fix image, format bootstrap
This commit is contained in:
49
bootstrap.sh
49
bootstrap.sh
@@ -18,14 +18,14 @@ DISTROLESS_NONROOT_UID="65532"
|
|||||||
clean-shokku() {
|
clean-shokku() {
|
||||||
echo "=> checking for existing resources"
|
echo "=> checking for existing resources"
|
||||||
|
|
||||||
if dokku apps:exists shokku &> /dev/null; then
|
if dokku apps:exists shokku &>/dev/null; then
|
||||||
echo "==> destroying old dokku app"
|
echo "==> destroying old dokku app"
|
||||||
dokku apps:destroy --force shokku &> /dev/null
|
dokku apps:destroy --force shokku &>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if dokku ssh-keys:list "$SHOKKU_DOKKU_USER" &> /dev/null; then
|
if dokku ssh-keys:list "$SHOKKU_DOKKU_USER" &>/dev/null; then
|
||||||
echo "==> removing existing dokku ssh key"
|
echo "==> removing existing dokku ssh key"
|
||||||
dokku ssh-keys:remove $SHOKKU_DOKKU_USER;
|
dokku ssh-keys:remove $SHOKKU_DOKKU_USER
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "==> done"
|
echo "==> done"
|
||||||
@@ -36,56 +36,56 @@ create-shokku-app() {
|
|||||||
|
|
||||||
echo "=> pulling image (version: $SHOKKU_VERSION)"
|
echo "=> pulling image (version: $SHOKKU_VERSION)"
|
||||||
HOST_SSH_PORT=$(grep "Port " /etc/ssh/sshd_config | awk '{ print $2 }')
|
HOST_SSH_PORT=$(grep "Port " /etc/ssh/sshd_config | awk '{ print $2 }')
|
||||||
docker pull "$SHOKKU_IMAGE" &> /dev/null
|
docker pull "$SHOKKU_IMAGE" &>/dev/null
|
||||||
SHOKKU_IMAGE_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "$SHOKKU_IMAGE")
|
SHOKKU_IMAGE_DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' "$SHOKKU_IMAGE")
|
||||||
|
|
||||||
echo "=> creating & configuring dokku app"
|
echo "=> creating & configuring dokku app"
|
||||||
dokku apps:create shokku &> /dev/null
|
dokku apps:create shokku &>/dev/null
|
||||||
dokku docker-options:add shokku deploy \
|
dokku docker-options:add shokku deploy \
|
||||||
"--add-host=host.docker.internal:host-gateway" &> /dev/null
|
"--add-host=host.docker.internal:host-gateway" &>/dev/null
|
||||||
dokku config:set shokku \
|
dokku config:set shokku \
|
||||||
DOKKU_SSH_HOST='host.docker.internal' \
|
DOKKU_SSH_HOST='host.docker.internal' \
|
||||||
DOKKU_SSH_PORT="$HOST_SSH_PORT" &> /dev/null
|
DOKKU_SSH_PORT="$HOST_SSH_PORT" &>/dev/null
|
||||||
|
|
||||||
echo "==> creating storage"
|
echo "==> creating storage"
|
||||||
dokku storage:ensure-directory shokku --chown false &> /dev/null
|
dokku storage:ensure-directory shokku --chown false &>/dev/null
|
||||||
dokku storage:mount shokku "$SHOKKU_APP_DATA_MOUNT_PATH" &> /dev/null
|
dokku storage:mount shokku "$SHOKKU_APP_DATA_MOUNT_PATH" &>/dev/null
|
||||||
chown -R "$DISTROLESS_NONROOT_UID":"$DISTROLESS_NONROOT_UID" "$SHOKKU_DATA_DIR" &> /dev/null
|
chown -R "$DISTROLESS_NONROOT_UID":"$DISTROLESS_NONROOT_UID" "$SHOKKU_DATA_DIR" &>/dev/null
|
||||||
|
|
||||||
echo "==> bootstrapping"
|
echo "==> bootstrapping"
|
||||||
dokku config:set shokku DOKKU_SKIP_DEPLOY=true &> /dev/null
|
dokku config:set shokku DOKKU_SKIP_DEPLOY=true &>/dev/null
|
||||||
dokku git:from-image shokku "$SHOKKU_IMAGE_DIGEST" &> /dev/null
|
dokku git:from-image shokku "$SHOKKU_IMAGE_DIGEST" &>/dev/null
|
||||||
|
|
||||||
shokku_ssh_key=$(dokku run shokku bootstrap) &> /dev/null
|
shokku_ssh_key=$(dokku run shokku bootstrap) &>/dev/null
|
||||||
echo "$shokku_ssh_key" | dokku ssh-keys:add "$SHOKKU_DOKKU_USER" &> /dev/null
|
echo "$shokku_ssh_key" | dokku ssh-keys:add "$SHOKKU_DOKKU_USER" &>/dev/null
|
||||||
|
|
||||||
echo "==> deploying"
|
echo "==> deploying"
|
||||||
dokku config:unset shokku DOKKU_SKIP_DEPLOY &> /dev/null
|
dokku config:unset shokku DOKKU_SKIP_DEPLOY &>/dev/null
|
||||||
|
|
||||||
echo "==> enabling letsencrypt"
|
echo "==> enabling letsencrypt"
|
||||||
dokku letsencrypt:enable shokku &> /dev/null
|
dokku letsencrypt:enable shokku &>/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
if [[ "$(id -u)" != "0" ]]; then
|
if [[ "$(id -u)" != "0" ]]; then
|
||||||
echo "This script must be run as root" 1>&2
|
echo "This script must be run as root" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! command -v dokku &> /dev/null; then
|
if ! command -v dokku &>/dev/null; then
|
||||||
echo "Please install dokku first using the instructions at https://dokku.com" 1>&2
|
echo "Please install dokku first using the instructions at https://dokku.com" 1>&2
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! dokku plugin:installed letsencrypt; then
|
if ! dokku plugin:installed letsencrypt; then
|
||||||
echo "Please setup letsencrypt using the instructions at https://dokku.com/docs/deployment/application-deployment/#setting-up-ssl" 1>&2
|
echo "Please setup letsencrypt using the instructions at https://dokku.com/docs/deployment/application-deployment/#setting-up-ssl" 1>&2
|
||||||
exit
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for plugin in redis postgres mongo mysql; do
|
for plugin in redis postgres mongo mysql; do
|
||||||
if ! dokku plugin:installed $plugin; then
|
if ! dokku plugin:installed $plugin; then
|
||||||
echo "=> Installing plugin $plugin"
|
echo "=> Installing plugin $plugin"
|
||||||
dokku plugin:install https://github.com/dokku/dokku-$plugin.git $plugin &> /dev/null
|
dokku plugin:install https://github.com/dokku/dokku-$plugin.git $plugin &>/dev/null
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -94,6 +94,7 @@ main() {
|
|||||||
shokku_app_domain=$(dokku domains:report shokku --domains-app-vhosts)
|
shokku_app_domain=$(dokku domains:report shokku --domains-app-vhosts)
|
||||||
shokku_setup_key=$(dokku logs -q shokku | grep setup_key | jq ".setup_key")
|
shokku_setup_key=$(dokku logs -q shokku | grep setup_key | jq ".setup_key")
|
||||||
|
|
||||||
|
echo "---"
|
||||||
echo "=> shokku installed and running "
|
echo "=> shokku installed and running "
|
||||||
echo "--- proceed with setup using key $shokku_setup_key at https://$shokku_app_domain ---"
|
echo "--- proceed with setup using key $shokku_setup_key at https://$shokku_app_domain ---"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<script>
|
<script>
|
||||||
export let title = "";
|
export let title = "";
|
||||||
|
const cardImgUrl = "https://shokku.dev/images/share-card.png"
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<meta property="og:title" content={title}>
|
<meta property="og:title" content={title}>
|
||||||
<meta property="og:type" content="website" />
|
<meta property="og:type" content="website" />
|
||||||
<meta property="og:image" content="https://shokku.dev/share-card.png">
|
<meta property="og:image" content={cardImgUrl}>
|
||||||
<meta name="twitter:card" content="https://shokku.dev/share-card.png">
|
<meta name="twitter:card" content={cardImgUrl}>
|
||||||
|
|
||||||
<meta property="og:description" content="Free and open source interface for the Dokku PaaS">
|
<meta property="og:description" content="Free and open source interface for the Dokku PaaS">
|
||||||
<meta name="twitter:image:alt" content="Shokku Logo">
|
<meta name="twitter:image:alt" content="Shokku Logo">
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
const scriptInstallCommands = [
|
const scriptInstallCommands = [
|
||||||
`wget "${bootstrapLink}"`,
|
`wget "${bootstrapLink}"`,
|
||||||
`export SHOKKU_LETSENCRYPT_EMAIL="foo@example.com"`,
|
`export SHOKKU_LETSENCRYPT_EMAIL="foo@example.com"`,
|
||||||
`sudo bash install.sh`,
|
`bash install.sh`,
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user