Skip to content

Instantly share code, notes, and snippets.

@YarGnawh
Last active June 15, 2018 17:22
Show Gist options
  • Save YarGnawh/57fbbd6aaa89771529690501aa4a480a to your computer and use it in GitHub Desktop.
Save YarGnawh/57fbbd6aaa89771529690501aa4a480a to your computer and use it in GitHub Desktop.
Initialization script for CodeAnywhere container
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get --yes --force-yes -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install language-pack-en-base
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install python-software-properties
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install software-properties-common
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install bzip2 build-essential apt-transport-https
# Install node
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
nvm install node
# Install mysql
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server mysql-client
# Install apache2
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install apache2 apache2-utils
# Install php
sudo DEBIAN_FRONTEND=noninteractive LC_ALL=en_US.UTF-8 add-apt-repository -y ppa:ondrej/php
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-curl php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
# Install composer
wget https://raw.githubusercontent.com/composer/getcomposer.org/1b137f8bf6db3e79a38a5bc45324414a6b1f9df2/web/installer -O - -q | php -- --quiet
chmod +x composer.phar
sudo mv composer.phar /usr/local/bin/composer
# Install wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
# Install yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo DEBIAN_FRONTEND=noninteractive apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install yarn
# Install bower
npm install -g bower gulp
sudo a2enmod rewrite
sudo service apache2 restart
# sudo usermod -a -G www-data cabox
# sudo chown -R cabox:www-data ~/workspace
# sudo chmod -R 775 ~/workspace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment