diff --git a/src/enrichment-authoring/.devcontainer.json b/src/enrichment-authoring/.devcontainer.json new file mode 100644 index 00000000..7f4399a8 --- /dev/null +++ b/src/enrichment-authoring/.devcontainer.json @@ -0,0 +1,29 @@ +{ + "name": "enrichment-authoring", + "dockerComposeFile": "docker-compose.yaml", + "service": "app", + "shutdownAction": "none", + "workspaceFolder": "/workspace", + "postCreateCommand": [ + "./startupscript/post-startup.sh", + "vscode", + "/home/vscode", + "${templateOption:cloud}", + "${templateOption:login}" + ], + "postStartCommand": [ + "./startupscript/remount-on-restart.sh", + "vscode", + "/home/vscode", + "${templateOption:cloud}", + "${templateOption:login}" + ], + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "17" + }, + "ghcr.io/devcontainers/features/aws-cli:1": {}, + "ghcr.io/dhoeric/features/google-cloud-cli:1": {} + }, + "remoteUser": "root" +} diff --git a/src/enrichment-authoring/README.md b/src/enrichment-authoring/README.md new file mode 100644 index 00000000..9a72c45e --- /dev/null +++ b/src/enrichment-authoring/README.md @@ -0,0 +1,43 @@ +# enrichment-authoring + +Custom Workbench application based on mcr.microsoft.com/devcontainers/base:ubuntu-24.04. + +## Configuration + +- **Image**: mcr.microsoft.com/devcontainers/base:ubuntu-24.04 +- **Port**: 8080 +- **User**: vscode +- **Home Directory**: /home/vscode + +## Access + +Once deployed in Workbench, access your terminal at the app URL (port 8080). + +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:8080` + +## 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 enrichment-authoring +``` + +## Usage + +1. Fork the repository +2. Modify the configuration files as needed +3. In Workbench UI, create a custom app pointing to your forked repository +4. Select this app template (enrichment-authoring) diff --git a/src/enrichment-authoring/devcontainer-template.json b/src/enrichment-authoring/devcontainer-template.json new file mode 100644 index 00000000..3bc95870 --- /dev/null +++ b/src/enrichment-authoring/devcontainer-template.json @@ -0,0 +1,20 @@ +{ + "id": "enrichment-authoring", + "version": "1.0.0", + "name": "enrichment-authoring", + "description": "Custom Workbench app: enrichment-authoring (Image: mcr.microsoft.com/devcontainers/base:ubuntu-24.04, Port: 8080, User: vscode)", + "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" + } + } +} diff --git a/src/enrichment-authoring/docker-compose.yaml b/src/enrichment-authoring/docker-compose.yaml new file mode 100644 index 00000000..776cfde9 --- /dev/null +++ b/src/enrichment-authoring/docker-compose.yaml @@ -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: "mcr.microsoft.com/devcontainers/base:ubuntu-24.04" + # build: + # context: . + restart: always + volumes: + - .:/workspace:cached + - work:/home/vscode/work + # The port specified here will be forwarded and accessible from the + # Workbench UI. + ports: + - 8080:8080 + # 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