From 659e8865949c0eae066b4517d03941148f66f8bc Mon Sep 17 00:00:00 2001 From: MatOgr Date: Fri, 30 Dec 2022 03:25:41 +0100 Subject: [PATCH] Cloud-init script --- code-server/cloud-init.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 code-server/cloud-init.yml diff --git a/code-server/cloud-init.yml b/code-server/cloud-init.yml new file mode 100644 index 0000000..02ac557 --- /dev/null +++ b/code-server/cloud-init.yml @@ -0,0 +1,34 @@ +#cloud-config +packages: + - apt-transport-https + - ca-certificates + - curl + - gnupg-agent + - software-properties-common +write_files: + - path: /root/docker-compose.yml + content: | + version: "2.1" + services: + code-server: + image: lscr.io/linuxserver/code-server:latest + container_name: code-server + environment: + - PUID=1000 + - PGID=1000 + - TZ=Europe/London + volumes: + - /path/to/appdata/config:/config + ports: + - 8443:8443 + restart: unless-stopped +runcmd: + - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - + - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" + - apt-get update -y + - apt-get install -y docker-ce docker-ce-cli containerd.io + - curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + - chmod +x /usr/local/bin/docker-compose + - systemctl start docker + - systemctl enable docker + - cd /root/ && docker-compose up -d