diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..847ba43 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,17 @@ +{ + "name": "Probot AWS Lambda", + "image": "mcr.microsoft.com/devcontainers/javascript-node:26-bookworm", + "remoteUser": "node", + "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind", + "workspaceFolder": "/workspace", + "mounts": [ + "source=${devcontainerId}-node-modules,target=/workspace/node_modules,type=volume" + ], + "postCreateCommand": "sudo chown \"$(id -u):$(id -g)\" node_modules && npm ci", + "forwardPorts": [3000], + "portsAttributes": { + "3000": { + "label": "Probot" + } + } +} diff --git a/README.md b/README.md index ef7e02e..fa6c5f1 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,18 @@ npm start Follow the instructions to register a new GitHub app. +### Develop in a container + +With Docker running and the VS Code Dev Containers extension installed, open +this repository and choose **Dev Containers: Reopen in Container**. The +[dev container](.devcontainer/devcontainer.json) uses Node.js 26 and runs +`npm ci`. Dependencies are stored in a separate Docker volume, so they do not +replace any host `node_modules`. + +Run `npm test` for a credential-free check, or run `npm start` and open the +forwarded Probot port (3000 by default). If you already have a local `.env`, it +is available in the mounted workspace and is not included in the container image. + ## Deployment In order to deploy the app from you local environment, follow the [Serverless Deploying to AWS documentation](https://www.serverless.com/framework/docs/providers/aws/guide/deploying).