|
20 | 20 |
|
21 | 21 | ## Application specification file |
22 | 22 |
|
23 | | -The application specification file allows you to define what Coder needs to |
| 23 | +To define custom applications, add a configuration file at |
| 24 | +`/coder/apps/config.yaml` to your image. |
| 25 | + |
| 26 | +The config file specifies the parameters Coder requires in order to |
24 | 27 | launch the application. Within the file, you can specify the following for each |
25 | 28 | application: |
26 | 29 |
|
27 | 30 | ```yaml |
28 | 31 | # /coder/apps/config.yaml |
29 | 32 |
|
30 | 33 | apps: |
31 | | - # Name of application in launcher |
| 34 | + # Name of application in launcher. Name may consist of alphanumeric |
| 35 | + # characters, dashes, underscores. Names must begin with an alphanumeric |
| 36 | + # character. Names must be unique per application. Required. |
| 37 | + # Regex used "^[a-zA-Z0-9]+[a-zA-Z0-9-_ ]{0,62}$". |
32 | 38 | - name: projector |
33 | | - # Application scheme - must be http or https |
| 39 | + # Application scheme - must be http or https. Required. |
34 | 40 | scheme: http |
35 | | - # Application port |
| 41 | + # Application port. Required. |
36 | 42 | port: 9999 |
37 | | - # Working directory |
| 43 | + # Host of the application to use when dialing. Defaults to localhost. |
| 44 | + # Optional. |
| 45 | + host: "localhost" |
| 46 | + # Working directory for the start command. Required. |
38 | 47 | working-directory: /home/coder |
39 | | - # File path to icon used in application launcher |
| 48 | + # File path to icon used in application launcher. Icons should be either |
| 49 | + # PNG, SVG, or JPG. Required. |
40 | 50 | icon-path: /home/coder/goland.svg |
41 | | - # Command to start the application |
| 51 | + # Command to start the application. Required. |
42 | 52 | command: /home/coder/.local/bin/projector |
43 | | - # Array of arguments for command |
| 53 | + # Array of arguments for command. Optional. |
44 | 54 | args: ["run"] |
45 | | - # Health checks to get running application status |
46 | | - # Can use exec or http health checks to localhost |
| 55 | + # Health checks to get running application status. Can use exec or http |
| 56 | + # health checks to localhost. It is recommended to specify a health-check |
| 57 | + # although not strictly required. If one is not supplied then an http |
| 58 | + # request is sent to the application root path "/". |
47 | 59 | health-check: |
| 60 | + # Exec commands require an exit code of '0' to report healthy. |
48 | 61 | exec: |
49 | 62 | command: "pgrep" |
50 | 63 | args: ["projector"] |
| 64 | + # http sends a GET request to the address specified via the parameters. |
| 65 | + # It expects a 200 status code to report healthy. |
51 | 66 | http: |
| 67 | + # Scheme must be "http" or "https". If not specified it inherits |
| 68 | + # the application scheme. Optional. |
52 | 69 | scheme: "http" |
53 | | - path: "/" |
| 70 | + # The host to use when dialing the address. If not specified it |
| 71 | + # inherits the application host. Optional. |
| 72 | + host: "localhost" |
| 73 | + # Port to use when dialing the application. If not specified it |
| 74 | + # inherits the application port. Optional. |
54 | 75 | port: 9999 |
| 76 | + # Path to use for the health check. If not specified defaults to |
| 77 | + # "/". Optional. |
| 78 | + path: "/healthz" |
55 | 79 | ``` |
56 | 80 |
|
57 | 81 | **Notes**: |
58 | 82 |
|
59 | | -- All top-level fields in the `config.yaml` file are required |
60 | | -- You must include at least one health check. The `exec` health check looks for |
61 | | - an exit code of `0`, while the `http` health check looks for the return of |
62 | | - `HTTP 200`. |
| 83 | +- A health check _must_ report healthy for you to access the application. |
| 84 | +- If you specify both the HTTP and Exec health checks, Coder prioritizes HTTP. |
63 | 85 |
|
64 | 86 | You can include the applications specification file in your |
65 | 87 | [workspace image](../images/writing.md). You an also modify the file via |
|
0 commit comments