24 lines
506 B
Bash
Executable file
24 lines
506 B
Bash
Executable file
#!/bin/bash
|
|
|
|
fatal() {
|
|
echo "FATAL: $@"
|
|
exit 1
|
|
}
|
|
|
|
echo "# installing docker"
|
|
sudo apt update || fatal "something went wrong"
|
|
sudo apt install "docker*" || fatal "something went wrong"
|
|
|
|
echo "# check groups"
|
|
if ! groups | grep docker; then
|
|
sudo usermod $USER -aG docker
|
|
fatal "please relog to enter docker group"
|
|
fi
|
|
|
|
echo "# network"
|
|
docker network create proxy
|
|
|
|
echo "# web"
|
|
[ -d /srv/www ] || sudo mkdir -p /srv/www
|
|
sudo chmod a+rw /srv/www
|
|
git clone git@git.faulty.nl:infra/web /srv/www
|