1
1
---
2
- title : " Applications "
2
+ title : " Workspace applications "
3
3
description : Learn how to access web apps running in your workspace.
4
4
state : beta
5
5
---
6
6
7
- You can connect to web applications installed on your workspace using the
7
+ You can connect to web applications installed on your workspace using an
8
8
applications specification file located at ` /coder/apps/config.yaml ` of the
9
9
workspace filesystem.
10
10
11
11
![ Application Launcher] ( ../assets/workspaces/applications.png )
12
12
13
- ## Enabling custom apps
13
+ ## Enabling workspace applications
14
14
15
- If you'd like to use custom apps in Coder, you can enable this feature in the
16
- UI:
15
+ If you'd like to use workspace applications in Coder, you can enable this
16
+ feature in the UI:
17
17
18
18
1 . In the top-right, click on your avatar and select ** Feature Preview** .
19
19
1 . Click ** Workspace applications** and select ** Enable** .
20
20
21
21
## Application specification file
22
22
23
- To define custom applications, add a configuration file at
23
+ To define workspace applications, add a configuration file at
24
24
` /coder/apps/config.yaml ` to your image.
25
25
26
- The config file specifies the parameters Coder requires in order to launch the
27
- application. Within the file, you can specify the following for each
28
- application:
26
+ The config file specifies the parameters Coder requires to launch the
27
+ application. Here is a sample ` config.yaml ` for adding a Python HTTP server as a
28
+ workspace application. Note that this requires the ` python3 ` binary, which is
29
+ included in Coder's base images.
29
30
30
31
``` yaml
31
32
# /coder/apps/config.yaml
@@ -34,23 +35,23 @@ apps:
34
35
# Name of application in launcher. Name may consist of alphanumeric
35
36
# characters, dashes, underscores. Names must begin with an alphanumeric
36
37
# character. Names must be unique per application. Required.
37
- - name : projector
38
+ - name : HTTP server
38
39
# Application scheme - must be http or https. Required.
39
40
scheme : http
40
41
# Application port. Required.
41
- port : 9999
42
+ port : 8000
42
43
# Host of the application to use when dialing. Defaults to localhost.
43
44
# Optional.
44
45
host : " localhost"
45
46
# Working directory for the start command. Required.
46
47
working-directory : /home/coder
47
48
# File path to icon used in application launcher. Icons should be either
48
49
# PNG, SVG, or JPG. Required.
49
- icon-path : /home/coder/goland.svg
50
+ icon-path : /home/coder/python-logo.png
50
51
# Command to start the application. Required.
51
- command : /home/coder/.local/bin/projector
52
+ command : python3
52
53
# Array of arguments for command. Optional.
53
- args : ["run "]
54
+ args : ["-m", "http.server "]
54
55
# Health checks to get running application status. Can use exec or http
55
56
# health checks to localhost. Optional, but we recommend specifying a
56
57
# health check. If you don't supply one, then an http request is sent to
59
60
# Exec commands require an exit code of '0' to report healthy.
60
61
exec :
61
62
command : " pgrep"
62
- args : ["projector "]
63
+ args : ["python3 "]
63
64
# http sends a GET request to the address specified via the parameters.
64
65
# Expects the status codes to match; default is HTTP 200.
65
66
http :
@@ -71,24 +72,44 @@ apps:
71
72
host : " localhost"
72
73
# Port to use when dialing the application. If not specified it
73
74
# inherits the application port. Optional.
74
- port : 9999
75
+ port : 8000
75
76
# Path to use for the health check. If not specified defaults to
76
77
# "/". Optional.
77
- path : " /healthz "
78
+ path : " "
78
79
` ` `
79
80
80
81
**Notes**:
81
82
82
83
- A health check _must_ report healthy for you to access the application.
83
84
- If you specify both the HTTP and Exec health checks, Coder prioritizes HTTP.
84
85
86
+ ### Image creation
87
+
88
+ When creating your image, be sure to:
89
+
90
+ 1. In the folder where your Dockerfile is, add a ` coder/apps` folder
91
+ 1. Add the `config.yaml` you created to `coder/apps`.
92
+ 1. Add the icon that you would like Coder to render for your app to the
93
+ ` coder/apps` folder
94
+ 1. Add a step to your Dockerfile to copy the `coder` folder into the image :
95
+
96
+ ` ` ` text
97
+ # copy custom apps info (config.yaml)
98
+ COPY ["./coder", "/coder"]
99
+ ` ` `
100
+
85
101
# # Sample usage
86
102
87
103
Coder offers an [image](https://hub.docker.com/r/codercom/enterprise-vnc) that
88
104
helps you [set up a VNC](../guides/customization/vnc.md). With a VNC available,
89
105
you can add an icon to your **Browser applications** via setting the
90
106
[config file](https://github.com/coder/enterprise-images/blob/91ef8f521b2275783fed54b27052cc544153cd99/images/vnc/coder/apps/config.yaml).
91
107
108
+ You are welcome to try the
109
+ [public Dockerfile repo that contains the example above](https://github.com/mtm20176/dockerfiles/tree/main/python/workspace-apps).
110
+ The repo includes config files that set up Python and Node.js HTTP servers and
111
+ the accompanying icons.
112
+
92
113
You can also see our
93
114
[blog post](https://coder.com/blog/run-any-application-or-ide-in-coder) for
94
115
further samples on adding tools like Portainer, Insomnia, and various versions
0 commit comments