Skip to content

Commit aa00559

Browse files
authored
removed projector from workspace apps, replaced with http server (#889)
1 parent e3d30a6 commit aa00559

File tree

2 files changed

+41
-20
lines changed

2 files changed

+41
-20
lines changed

manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,6 @@
5353
{
5454
"path": "./workspaces/lifecycle.md"
5555
},
56-
{
57-
"path": "./workspaces/applications.md"
58-
},
5956
{
6057
"path": "./workspaces/autostart.md"
6158
},
@@ -86,6 +83,9 @@
8683
{
8784
"path": "./workspaces/vs-code-extensions.md"
8885
},
86+
{
87+
"path": "./workspaces/applications.md"
88+
},
8989
{
9090
"path": "./workspaces/workspace-params.md"
9191
},

workspaces/applications.md

+38-17
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
---
2-
title: "Applications"
2+
title: "Workspace applications"
33
description: Learn how to access web apps running in your workspace.
44
state: beta
55
---
66

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
88
applications specification file located at `/coder/apps/config.yaml` of the
99
workspace filesystem.
1010

1111
![Application Launcher](../assets/workspaces/applications.png)
1212

13-
## Enabling custom apps
13+
## Enabling workspace applications
1414

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:
1717

1818
1. In the top-right, click on your avatar and select **Feature Preview**.
1919
1. Click **Workspace applications** and select **Enable**.
2020

2121
## Application specification file
2222

23-
To define custom applications, add a configuration file at
23+
To define workspace applications, add a configuration file at
2424
`/coder/apps/config.yaml` to your image.
2525

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.
2930

3031
```yaml
3132
# /coder/apps/config.yaml
@@ -34,23 +35,23 @@ apps:
3435
# Name of application in launcher. Name may consist of alphanumeric
3536
# characters, dashes, underscores. Names must begin with an alphanumeric
3637
# character. Names must be unique per application. Required.
37-
- name: projector
38+
- name: HTTP server
3839
# Application scheme - must be http or https. Required.
3940
scheme: http
4041
# Application port. Required.
41-
port: 9999
42+
port: 8000
4243
# Host of the application to use when dialing. Defaults to localhost.
4344
# Optional.
4445
host: "localhost"
4546
# Working directory for the start command. Required.
4647
working-directory: /home/coder
4748
# File path to icon used in application launcher. Icons should be either
4849
# PNG, SVG, or JPG. Required.
49-
icon-path: /home/coder/goland.svg
50+
icon-path: /home/coder/python-logo.png
5051
# Command to start the application. Required.
51-
command: /home/coder/.local/bin/projector
52+
command: python3
5253
# Array of arguments for command. Optional.
53-
args: ["run"]
54+
args: ["-m", "http.server"]
5455
# Health checks to get running application status. Can use exec or http
5556
# health checks to localhost. Optional, but we recommend specifying a
5657
# health check. If you don't supply one, then an http request is sent to
@@ -59,7 +60,7 @@ apps:
5960
# Exec commands require an exit code of '0' to report healthy.
6061
exec:
6162
command: "pgrep"
62-
args: ["projector"]
63+
args: ["python3"]
6364
# http sends a GET request to the address specified via the parameters.
6465
# Expects the status codes to match; default is HTTP 200.
6566
http:
@@ -71,24 +72,44 @@ apps:
7172
host: "localhost"
7273
# Port to use when dialing the application. If not specified it
7374
# inherits the application port. Optional.
74-
port: 9999
75+
port: 8000
7576
# Path to use for the health check. If not specified defaults to
7677
# "/". Optional.
77-
path: "/healthz"
78+
path: ""
7879
```
7980
8081
**Notes**:
8182
8283
- A health check _must_ report healthy for you to access the application.
8384
- If you specify both the HTTP and Exec health checks, Coder prioritizes HTTP.
8485
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+
85101
## Sample usage
86102

87103
Coder offers an [image](https://hub.docker.com/r/codercom/enterprise-vnc) that
88104
helps you [set up a VNC](../guides/customization/vnc.md). With a VNC available,
89105
you can add an icon to your **Browser applications** via setting the
90106
[config file](https://github.com/coder/enterprise-images/blob/91ef8f521b2275783fed54b27052cc544153cd99/images/vnc/coder/apps/config.yaml).
91107

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+
92113
You can also see our
93114
[blog post](https://coder.com/blog/run-any-application-or-ide-in-coder) for
94115
further samples on adding tools like Portainer, Insomnia, and various versions

0 commit comments

Comments
 (0)