make install script
This commit is contained in:
39
setup.sh
Executable file
39
setup.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/bash
|
||||
# setup photoview
|
||||
# run as root
|
||||
|
||||
if [[ $(id -u) != "0" ]]; then
|
||||
echo RUN AS ROOT!!
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# install docker
|
||||
apt-get update
|
||||
apt-get install ca-certificates curl gnupg -y
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
|
||||
chmod a+r /etc/apt/keyrings/docker.gpg
|
||||
echo \
|
||||
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
|
||||
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" > /etc/apt/sources.list.d/docker.list
|
||||
apt-get update
|
||||
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
|
||||
|
||||
# where to store photos
|
||||
read -p "Kde chcete mít fotky? [/mnt/fotky]"
|
||||
PHOTOS=${REPLY-/mnt/fotky}
|
||||
echo $PHOTOS
|
||||
|
||||
# serve at what domain
|
||||
read -p "Na jaké doméně budou stránky? "
|
||||
DOMAIN=${REPLY?Musíte mít doménu}
|
||||
echo $DOMAIN
|
||||
|
||||
# make config files
|
||||
mkdir -p $HOME/etc/caddy
|
||||
sed -e "s/__DOMAIN__/$DOMAIN/" Caddyfile > $HOME/etc/caddy/caddyfile
|
||||
sed -e "s/__PHOTO__/$PHOTOS/" docker-compose.yml > $HOME/etc
|
||||
|
||||
# install
|
||||
cd $HOME/etc
|
||||
docker compose up -d
|
||||
Reference in New Issue
Block a user