Skip to content
Snippets Groups Projects
cloud-init.yml 2.19 KiB
Newer Older
  • Learn to ignore specific revisions
  • # System update
    
    package_update: true
    package_upgrade: true
    
    
    # Install Packages
    
    Nathan Rodet's avatar
    Nathan Rodet committed
    packages:
      - curl
      - git
    
    
    Nathan Rodet's avatar
    Nathan Rodet committed
    write_files:
      path: /root/atrium.yaml
      content: |
        hostname: $(scw-userdata atrium_hostname)
        debug_mode: false
        letsencrypt_email: $(scw_userdata atrium_letsencrypt_email)
        apps: # optional : applications served by atrium
          - id: 1
            name: Code
            icon: web_asset
            color: 4292030255
            is_proxy: true
            host: "code-$(scw_userdata atrium_count_index)"
            target: $(scw_userdata atrium_private_ip):8080
        apps: # optional : applications served by atrium
          - id: 2
            name: Desktop
            icon: web_asset
            color: 4292030255
            is_proxy: true
            host: "desktop-$(scw_userdata atrium_count_index)"
            target: $(scw_userdata atrium_private_ip):8081
    
    
    # Install Rust
    
      - "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y"
      - "source \"$HOME/.cargo/env\""
    
    # Install Docker
    
      - "curl -fsSL https://get.docker.com -o get-docker.sh"
      - "sh get-docker.sh"
    
    Nathan Rodet's avatar
    Nathan Rodet committed
    # Setup Atrium
      - "mkdir -p /root/data/letsencrypt_cache && mkdir /root/app"
      - "cp -f /root/atrium.yaml /root/data/app/atrium.yaml"
    # Run Atrium Container
      - "docker run -d --name atrium --net=host -v /root/atrium.yaml:/app/atrium.yaml -v /root/GeoLite2-City.mmdb:/app/GeoLite2-City.mmdb -v /root/letsencrypt_cache:/app/letsencrypt_cache -v /root/data:/app/data nicolaspernoud/atrium:latest"
    
    # Install Code Server
    
      - "curl -fsSL https://code-server.dev/install.sh | sh"
      - "mkdir -p  /root/.config/code-server/"
    
      - 'echo "bind-addr: 0.0.0.0:8080\nauth: password\npassword: $(scw-userdata user_password)\ncert: false\n" > /root/.config/code-server/config.yaml'
    
    # Run Code Server
    
    Nathan Rodet's avatar
    Nathan Rodet committed
      - "systemctl enable --now code-server@$USER"
    
    # Run Webtop Container
    
    Nathan Rodet's avatar
    Nathan Rodet committed
      - "docker run -d --name=webtop --security-opt seccomp=unconfined -e PUID=0 -e PGID=0 -e TZ=Europe/Paris -e SUBFOLDER=/ -e KEYBOARD=fr-fr-azerty -e AUTO_LOGIN=false -p 80:3000 -v /root/webtop_data/:/config -v /var/run/docker.sock:/var/run/docker.sock --shm-size=8gb --cap-add=NET_ADMIN --privileged --restart unless-stopped --sysctl net.ipv6.conf.all.disable_ipv6=0 lscr.io/linuxserver/webtop:ubuntu-xfce"