Coderank Configuration File
This file named coderank.json located in the .coderank directory helps to setup your resource to your liking.
The file looks like this:
{ "type": "web", "run": { "build": "npm run build", "start": "npm start", "workDir": "/root/workspace", "port": "3001" }, "ports": [3000, 3001], "dependencies": { "apt": ["rsync"] } }
File Sections
Each section controls a pecific aspect of your resource.
type
The type section indicates what kind of application you aim to run. Currently we support web and shell application types.
web
A web type represents a web application that will be accessed via http.
shell
A shell type represents an application that will be run via the terminal.
run
The run section gives us information to execute your application. it depends on the type of application. For a web application you need the start and port values at a minimum. Others are optional.
{ "build": "npm run build", "start": "npm start", "workDir": "/root/workspace", "port": "3001" }
For a shell application you only need the start command. Optional values also apply.
{ "start": "./start.sh" }
ports
This is a list of ports to be exposed by the container. Maximum 3 ports. The ports simply determine which subdomains should be used for SSL.
"ports": [3000, 3001]
dependencies
Dependencies are packages which your container depends on. All presets are debian based for now, so we currently only allow apt packages.
"dependencies": { "apt": ["rsync", "neofetch"] }
extensions
These are vscode extensions specifically from the code-server extension marketplace Extensions are represented by their ids.
"extensions": [ "esbenp.prettier-vscode", "mads-hartmann.bash-ide-vscode" ]
Config File Type Definition
The full config file type looks like this:
type CoderankConfig = { type: "web" | "shell"; run: { start: string; port?: string; workDir?: string; // Defaults to `/root/workspace` build?: string; }; ports: number[]; dependencies?: { apt?: string[]; }; extensions: string[]; };