Skip to content

Instantly share code, notes, and snippets.

@69
Last active November 21, 2019 18:16
Show Gist options
  • Save 69/1b64752164da869cc76a33f329f65c91 to your computer and use it in GitHub Desktop.
Save 69/1b64752164da869cc76a33f329f65c91 to your computer and use it in GitHub Desktop.
Setting up your portal image on Debian 9

Setting up your portal image on Debian 9

  • Start with creating a server with Debian 9 (codename stretch)
  • When you have your server running, update your repository data and install apt-transport-https, git, software-properties-common, gnupg2 and curl:
    apt update && apt install apt-transport-https git software-properties-common gnupg2 curl -y
  • Add the docker repo and install docker-ce. (instructions)
  • Add the yarn repo and install yarn. (instructions)
  • Install nvm. (instructions)
  • Install the latest version of Node:
    nvm install --lts
  • Create a limited user for setting up the Docker container and add it to the docker user group:
    adduser --gecos '' --disabled-password cryb && \
    usermod -aG docker cryb
  • Switch to the cryb user:
    su - cryb
  • Continue by cloning the @crybapp/portal repo:
    git clone https://github.com/crybapp/portal.git
  • Copy .env.example over to .env and set it up so the VM can communicate with your API and aperture servers
  • Run yarn and yarn docker:build in the portal folder
  • Once the build succeeds, create a start.sh shell script in your home directory and insert the following code inside it:
    SHM_SIZE="1gb"
    cd /home/cryb/portal && docker run --rm -i --net=host --shm-size="$SHM_SIZE" cryb/portal
  • Make the shell script executable:
    chmod +x ~/start.sh
  • Create a crontab entry using crontab -e and insert the following:
    @reboot /home/cryb/start.sh
  • Power off your snapshot and take a snapshot/image.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment