Skip to content

Commit fc0a12a

Browse files
author
Aurang
authored
Create configuring_environment.md
1 parent d18efea commit fc0a12a

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

guides/configuring_environment.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Configure code-server and environemnt
2+
### Changing START_DIR in [entrypoint.sh](/deploy-container/entrypoint.sh) or getting Directory '/home/coder/poject' does not exist
3+
If you change the directory and now code-server wont work, or if you are getting errors containg the starting directory that say it doesnt exist, you can add the following command into the Dockerfile to create the starting directory
4+
```Dockerfile
5+
# Create starting directory
6+
# Should be the same as $START_DIR in entrypoint.sh
7+
RUN mkdir /home/coder/files
8+
```
9+
___
10+
### Using a config.yaml file for code-server
11+
code-server will automatically generate a configuration file [[Source]](https://github.com/cdr/code-server/blob/main/docs/FAQ.md#how-does-the-config-file-work)<br>
12+
You can create a config.yaml file in the deploy-container directory containing your code-server configuration.<br>
13+
Afterwards, in order for it to be used, you will need to add these Docker commands to the Dockerfile
14+
```Dockerfile
15+
# Create config directory
16+
RUN mkdir /home/coder/.config
17+
18+
# Copy config file
19+
# The path to the file bing copied should be the same as where you created the config file
20+
COPY deploy-container/config.yaml /home/coder/.config/code-server/config.yaml
21+
```
22+
Now you can edit entrypoint.sh and change the last line to
23+
```shell
24+
# Now we can run code-server with the default entrypoint
25+
# The path to the config file should be where it was copied to
26+
/usr/bin/entrypoint.sh --config /home/coder/.config/code-server/config.yaml --bind-addr 0.0.0.0:8080 $START_DIR
27+
```
28+
Or you can set the CODE_SERVER_CONFIG environment variable to the path of your configuration file<br>
29+
For more information about this, see [cdr/code-server/main/docs/FAQ.md](https://github.com/cdr/code-server/blob/main/docs/FAQ.md#how-does-the-config-file-work)
30+
___
31+
### Changing the default vscode settings that get apllied each time the container is rebuilt
32+
You can simply edit deploy-container/settings.json to your vscode settings. When the container gets rebuilt, they will be copied to the appropriate place and be applied in code-server.<br>
33+
> NOTE: These settings are applied User-wide

0 commit comments

Comments
 (0)