-
-
Save BlackPeter13/c07fc701438059ab511d494109c45ebc to your computer and use it in GitHub Desktop.
Setup Debian machine for docker-compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash -x | |
| COMPOSE_VERSION="1.23.2" | |
| COMPOSE_URL="https://github.com/docker/compose/releases/download/$COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" | |
| # Opendax bootstrap script | |
| install_core() { | |
| sudo bash <<EOS | |
| apt-get update | |
| apt-get remove -y --purge unscd | |
| userdel -r debian | |
| apt-get install -y -q git tmux gnupg2 dirmngr dbus htop curl libmariadbclient-dev-compat build-essential | |
| useradd -m -G root -p '*' -s /bin/bash app | |
| EOS | |
| } | |
| log_rotation() { | |
| sudo bash <<EOS | |
| mkdir -p /etc/docker | |
| echo ' | |
| { | |
| "log-driver": "json-file", | |
| "log-opts": { | |
| "max-size": "10m", | |
| "max-file": "10" | |
| } | |
| }' > /etc/docker/daemon.json | |
| EOS | |
| } | |
| # Docker installation | |
| install_docker() { | |
| curl -fsSL https://get.docker.com/ | bash | |
| sudo bash <<EOS | |
| usermod -a -G docker app | |
| curl -L "$COMPOSE_URL" -o /usr/local/bin/docker-compose | |
| chmod +x /usr/local/bin/docker-compose | |
| EOS | |
| } | |
| install_ruby() { | |
| sudo -u app bash <<EOS | |
| gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB | |
| curl -sSL https://get.rvm.io | bash -s stable | |
| source /home/app/.rvm/scripts/rvm | |
| rvm autolibs disable | |
| rvm install 2.6.5 | |
| EOS | |
| } | |
| install_core | |
| log_rotation | |
| install_docker | |
| install_ruby | |
| sudo -u app /bin/bash --login | |
| cd /home/app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment