Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/deploy-code-serverPublic template

Commitcecaa7d

Browse files
committed
add instructions for running locally
1 parent7475972 commitcecaa7d

File tree

1 file changed

+33
-21
lines changed

1 file changed

+33
-21
lines changed

‎deploy-container/README.md

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,37 @@ An container image built for deploying code-server.
44

55
##Guides
66

7-
*[Deploy on Railway](../guides/railway.md)
8-
*[Deploy on Heroku](../guides/heroku.md)
7+
-[Deploy on Railway](../guides/railway.md)
8+
-[Deploy on Heroku](../guides/heroku.md)
99

1010
Docker Hub:`bencdr/code-server-deploy-container`
1111

12+
To run the container locally, you can use:
13+
14+
```
15+
docker run -p 127.0.0.1:8080:8080 \
16+
-v "$PWD/project:/home/coder/project" \
17+
-u "$(id -u):$(id -g)" \
18+
-e "DOCKER_USER=$USER" \
19+
-e "PASSWORD=12345" \
20+
-it bencdr/code-server-deploy-container:latest
21+
```
22+
1223
##Modifying your code-server environment
1324

1425
To update your code-server version, modify the version number on line 2 in your Dockerfile. See the[list of tags](https://hub.docker.com/r/codercom/code-server/tags?page=1&ordering=last_updated) for the latest version.
1526

1627
We've included some examples on how to add additoonal dependencies in the root-level[Dockerfile](../Dockerfile):
1728

18-
```Dockerfile
29+
```Dockerfile
1930
# Install a VS Code extension:
2031
# Note: we use a different marketplace than VS Code. See https://github.com/cdr/code-server/blob/main/docs/FAQ.md#differences-compared-to-vs-code
2132
RUN code-server --install-extension esbenp.prettier-vscode
2233

2334
# Install apt packages:
2435
RUN sudo apt-get install -y ubuntu-make
2536

26-
# Copy files:
37+
# Copy files:
2738
COPY deploy-container/myTool /home/coder/myTool
2839
```
2940

@@ -33,11 +44,12 @@ COPY deploy-container/myTool /home/coder/myTool
3344

3445
| Variable Name| Description| Default Value|
3546
| -----------------| ------------------------------------------------------------------------------------------------| -------------------|
36-
|`PASSWORD`| Password for code-server||
47+
|`PASSWORD`| Password for code-server||
3748
|`HASHED_PASSWORD`| Overrrides PASSWORD.[SHA-256 hash](https://xorbin.com/tools/sha256-hash-calculator) of password|
38-
|`USE_LINK`| Use code-server --link instead of a password (coming soon)| false|
39-
|`GIT_REPO`| A git repository to clone||
40-
|`START_DIR`| The directory code-server opens (and clones repos in)| /home/coder/project|
49+
|`USE_LINK`| Use code-server --link instead of a password (coming soon)| false|
50+
|`GIT_REPO`| A git repository to clone||
51+
|`START_DIR`| The directory code-server opens (and clones repos in)| /home/coder/project|
52+
4153
---
4254

4355
Other code-server environment variables (such as`CODE_SERVER_CONFIG` ) can also be used. See the[code-server FAQ](https://github.com/cdr/code-server/blob/main/docs/FAQ.md) for details.
@@ -48,7 +60,7 @@ This image has built-in support for [rclone](https://rclone.org/) so that your f
4860

4961
You can generate the rclone config on any machine, but it works great on the code-server environment itself, or Google Cloud Shell :)
5062

51-
```sh
63+
```sh
5264
# 1. install rclone
5365
# see https://rclone.org/install/ for other install options
5466
$ curl https://rclone.org/install.sh| sudo bash
@@ -65,16 +77,16 @@ Now, you can add the following the environment variables in the code-server clou
6577

6678
| Environment Variable| Description| Default Value| Required|
6779
| --------------------| -----------------------------------------------------------------------------------------------------------------------------------------------------| --------------------------------------------| --------|
68-
| RCLONE_DATA| the encoded rclone config you copied in step 3| n/a||
69-
| RCLONE_REMOTE_NAME| the name of the remote you added in step 2.<br />check with`$ rclone listremotes`| code-server-remote||
80+
| RCLONE_DATA| the encoded rclone config you copied in step 3| n/a||
81+
| RCLONE_REMOTE_NAME| the name of the remote you added in step 2.<br />check with`$ rclone listremotes`| code-server-remote||
7082
| RCLONE_SOURCE| source directory to sync files in the code-server container| the project directory:`/home/coder/project`||
7183
| 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||
72-
| RCLONE_VSCODE_TASKS| import push and pull shortcuts into VS Code![rclone screenshot from VS Code](../img/rclone-vscode-tasks.png)| true|
84+
| RCLONE_VSCODE_TASKS| import push and pull shortcuts into VS Code![rclone screenshot from VS Code](../img/rclone-vscode-tasks.png)| true|
7385
| RCLONE_AUTO_PUSH| automatically push files on startup if the rclone remote is empty (environment -> rclone remote)| true||
7486
| RCLONE_AUTO_PULL| automatically pull files on startup if the rclone remote is not empty (rclone -> environment remote)| true||
75-
| RCLONE_FLAGS| additional flags to attach to the push and pull script.<br />type`$ rclone help flags` for a list.|||
87+
| RCLONE_FLAGS| additional flags to attach to the push and pull script.<br />type`$ rclone help flags` for a list.|||
7688

77-
```sh
89+
```sh
7890

7991
# --- How to use ---
8092

@@ -83,23 +95,23 @@ $ sh /home/coder/push_remote.sh # save your uncomitted files to the remote
8395
$ sh /home/coder/pull_remote.sh# get latest files from the remote
8496

8597
# In VS Code:
86-
# use items in bottom bar or ctrl + P, run task: push_remote or pull_remote or
98+
# use items in bottom bar or ctrl + P, run task: push_remote or pull_remote or
8799
```
88100

89101
###Popular rclone flags
90102

91103
To avoid syncing unnecessary directories, add this to`RCLONE_FLAGS` :
92104

93-
```none
105+
```none
94106
--exclude "node_modules/**" --exclude ".git/**"
95107
```
96108

97109
---
98110

99111
##Todo
100112

101-
*[ ] Make`push_remote` and`pull_remote` commands in path
102-
*[ ] Impliment file watcher or auto file sync in VS Code
103-
*[ ] Attach a "push" on a git stash??
104-
*[ ] Add support for SSH / VS Code remote access
105-
*[ ] Make rclone logs visible in environment for debugging
113+
-[ ] Make`push_remote` and`pull_remote` commands in path
114+
-[ ] Impliment file watcher or auto file sync in VS Code
115+
-[ ] Attach a "push" on a git stash??
116+
-[ ] Add support for SSH / VS Code remote access
117+
-[ ] Make rclone logs visible in environment for debugging

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp