Skip to content

Instantly share code, notes, and snippets.

@bpmct
Last active March 3, 2021 07:23
Show Gist options
  • Save bpmct/f2b755955e3fd9a7b3859e033b3430fe to your computer and use it in GitHub Desktop.
Save bpmct/f2b755955e3fd9a7b3859e033b3430fe to your computer and use it in GitHub Desktop.
deploy-code-server.md

deploy-code-server

A collection of one-click buttons and tutorials for deploying code-server to various cloud hosting platforms. The fastest way to get a code-server environment! ☁️

Platform Type Cheapest Plan Deploy
DigitalOcean VM Test
Vultr VM $10 credit Test
Railway App Platform Test
Heroku App Platform Test
Azure App Service ✅ 1 GB RAM Test

More modifications!!

some additional stuff some additional stuff some additional stuff some additional stuff some additional stuff

Using a VM vs. App Platform

  • VMs are deployed once, and then can be modified to install new software
    • You need to save "snapshots" to use your latest images
    • Storage is always persistent, and you can usually add extra volumes
    • VMs can support many workloads, such as running Docker or Kubernetes clusters
  • App Platforms deploy code-server containers, and are often rebuilt
    • App platforms can shut down when you are not using it, saving you money
    • All software and dependencies need to be defined in the Dockerfile or install script so they aren't destroyed on a rebuild
    • Storage may not be redundant. You may have to use rclone to store your filesystem on a cloud service

App Platform Config

Below are the environment variables that are avalible when deploying code-server to any app platform with the bencdr/deploy-code-server image (coming soon):

GIT_REPO: a git repo to clone and open in code-server (optional)
PASSWORD: your password to log in to code-server
SSH_KEY: a public SSH key that could be used for git or other services

Extending your app platform image

To add additional software or settings to your image, modify the Dockerfile.

# Dockerfile
FROM bencdr/deploy-code-server:latest

# run commands
RUN apt-get install ...

# install VS Code extensions
RUN code-server --install-extension ...

# copy files
COPY repo/ /home/coder/repo
this

that this

  • bullet
  • point
  • is
  • here

what are you doin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment