|
1 |
| -# code-server-railway |
| 1 | +# deploy-code-server |
2 | 2 |
|
3 |
| -An image built for deploying code-server to [railway.app](https://railway.app). |
| 3 | +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! ☁️ |
4 | 4 |
|
5 |
| -To launch your code-server environment, click the button below and log in with GitHub. |
6 |
| - |
7 |
| -[](https://railway.app/new?template=https%3A%2F%2Fgithub.com%2Fbpmct%2Fcode-server-railway&envs=PASSWORD%2CGIT_REPO&PASSWORDDesc=Your+password+to+log+in+to+code-server+with&GIT_REPODesc=A+git+repo+to+clone+and+open+in+code-server+%28ex.+https%3A%2F%2Fgithub.com%2Fcdr%2Fdocs.git%29) |
8 |
| - |
9 |
| -It will ask you to make a new repo to store this image, so you can add additional software to your repo's `Dockerfile` in the future. |
10 |
| - |
11 |
| - |
12 |
| - |
13 |
| -## 💾 Persist your filesystem with `rclone` |
14 |
| - |
15 |
| -This image has built-in support for [rclone](https://rclone.org/) so that your files don't get lost when code-server is re-deployed. |
16 |
| - |
17 |
| -You can generate the rclone config on any machine, but it works great on the code-server environment itself, or Google Cloud Shell :) |
18 |
| - |
19 |
| -```sh |
20 |
| -# 1. install rclone |
21 |
| -# see https://rclone.org/install/ for other install options |
22 |
| -$ curl https://rclone.org/install.sh | sudo bash |
23 |
| - |
24 |
| -# 2. create a new rclone remote with your favorite storage provider ☁️ |
25 |
| -$ rclone config |
26 |
| - |
27 |
| -# 3. Encode your rclone config and copy to your clipboard |
28 |
| -$ cat $(rclone config file | sed -n 2p) | base64 --wrap=0 # Linux |
29 |
| -$ cat $(rclone config file | sed -n 2p) | base64 --b 0 # MacOS |
30 |
| -``` |
31 |
| - |
32 |
| -Now, you can add the following the environment variables in the code-server cloud app: |
33 |
| - |
34 |
| -| Environment Variable | Description | Default Value | Required | |
35 |
| -| -------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- | -------- | |
36 |
| -| RCLONE_DATA | the encoded rclone config you copied in step 3 | n/a | ✅ | |
37 |
| -| RCLONE_REMOTE_NAME | the name of the remote you added in step 2.<br />check with `$ rclone listremotes` | code-server-remote | | |
38 |
| -| RCLONE_SOURCE | source directory to sync files in the code-server container | the project directory: `/home/coder/project` | | |
39 |
| -| RCLONE_DESTINATION | the path in the remote that rclone syncs to. change this if you have multiple code-server environments, or if you want to better organize your files. | code-server-files | | |
40 |
| - |
41 |
| -```sh |
42 |
| - |
43 |
| -# How to use: |
44 |
| - |
45 |
| -$ sh /home/coder/push_remote.sh # save your uncomitted files to the remote |
46 |
| - |
47 |
| -$ sh /home/coder/pull_remote.sh # get latest files from the remote |
48 |
| -``` |
| 5 | +| Platform | Type | Cheapest Plan | Deploy | |
| 6 | +| ----------------- | ---------------- | ------------------------------------- | ------ | |
| 7 | +| DigitalOcean | VM | $5/mo, 1 CPU, 1 GB RAM | Test | |
| 8 | +| Vultr | VM | $5/mo, 1 CPU, 1 GB RAM | Test | |
| 9 | +| Linode | VM | $3.50/mo, 1 CPU, 512 MB RAM | Test | |
| 10 | +| Railway | Deploy Container | Free, specs unknown, but very fast 🚀 | Test | |
| 11 | +| Heroku | Deploy Container | Free, 1 CPU, 512 MB RAM | Test | |
| 12 | +| Azure App Service | Deploy Container | Free, 1 CPU, 1 GB RAM | Test | |
49 | 13 |
|
50 | 14 | ---
|
51 | 15 |
|
52 |
| -## Todo: |
| 16 | +## Using a VM vs. Deploying a Container |
53 | 17 |
|
54 |
| -- [ ] Make `push_remote` and `pull_remote` commands in path |
55 |
| -- [ ] Impliment file watcher or auto file sync in VS Code |
56 |
| -- [ ] Attach a "push" on a git stash?? |
57 |
| -- [ ] Add support for SSH / VS Code remote access |
58 |
| -- [ ] Make rclone logs visible in environment for debugging |
| 18 | +- VMs are deployed once, and then can be modified to install new software |
| 19 | + - You need to save "snapshots" to use your latest images |
| 20 | + - Storage is always persistent, and you can usually add extra volumes |
| 21 | + - VMs can support many workloads, such as running Docker or Kubernetes clusters |
| 22 | +- App Platforms deploy code-server containers, and are often rebuilt |
| 23 | + - App platforms can shut down when you are not using it, saving you money |
| 24 | + - All software and dependencies need to be defined in the `Dockerfile` or install script so they aren't destroyed on a rebuild |
| 25 | + - Storage may not be redundant. You may have to use [rclone](https://rclone.org/) to store your filesystem on a cloud service |
0 commit comments