Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/test-app/.devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "test-app",
"dockerComposeFile": "docker-compose.yaml",
"service": "app",
"shutdownAction": "none",
"workspaceFolder": "/workspace",
"remoteUser": "root"
}
43 changes: 43 additions & 0 deletions src/test-app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# test-app

Integration test-only custom Workbench application based on docker/getting-started.


## Configuration

- **Image**: docker/getting-started
- **Port**: 8001
- **User**: root
- **Home Directory**: /root

## Access

Once deployed in Workbench, access your terminal at the app URL (port 80).

For local testing:
1. Create Docker network: `docker network create app-network`
2. Run the app: `devcontainer up --workspace-folder .`
3. Access at: `http://localhost:8001`

## Customization

Edit the following files to customize your app:

- `.devcontainer.json` - Devcontainer configuration and features
- `docker-compose.yaml` - Docker Compose configuration (change the `command` to customize ttyd options)
- `devcontainer-template.json` - Template options and metadata

## Testing

To test this app template:

```bash
cd test
./test.sh test-app
```

## Usage

1. Create app and select custom
2. Specify https://github.com/verily-src/workbench-app-devcontainers.git and branch `master` and src/test-app

20 changes: 20 additions & 0 deletions src/test-app/devcontainer-template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"id": "test-app",
"version": "1.0.0",
"name": "test-app",
"description": "Custom Workbench app: test-app (Image: docker/getting-started, Port: 80, User: root)",
"options": {
"cloud": {
"type": "string",
"enum": ["gcp", "aws"],
"default": "gcp",
"description": "Cloud provider (gcp or aws)"
},
"login": {
"type": "string",
"description": "Whether to log in to workbench CLI",
"proposals": ["true", "false"],
"default": "false"
}
}
}
36 changes: 36 additions & 0 deletions src/test-app/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
services:
app:
# The container name must be "application-server"
container_name: "application-server"
# This can be either a pre-existing image or built from a Dockerfile
image: "docker/getting-started"
# build:
# context: .
restart: always
volumes:
- .:/workspace:cached
- work:/root/work
# The port specified here will be forwarded and accessible from the
# Workbench UI.
ports:
- 8001:80
# The service must be connected to the "app-network" Docker network
networks:
- app-network
# SYS_ADMIN and fuse are required to mount workspace resources into the
# container.
cap_add:
- SYS_ADMIN
devices:
- /dev/fuse
security_opt:
- apparmor:unconfined

volumes:
work:

networks:
# The Docker network must be named "app-network". This is an external network
# that is created outside of this docker-compose file.
app-network:
external: true