From 18b7ee5f37b9566286bdc21bab98914a76137508 Mon Sep 17 00:00:00 2001 From: Alvaro Videla Date: Tue, 12 Sep 2023 00:51:02 +0200 Subject: [PATCH] adds devcontainer support for file-q-and-a app (#218) --- apps/file-q-and-a/nextjs/.devcontainer/Dockerfile | 2 ++ apps/file-q-and-a/nextjs/.devcontainer/devcontainer.json | 5 +++++ apps/file-q-and-a/nextjs/README.md | 2 ++ 3 files changed, 9 insertions(+) create mode 100644 apps/file-q-and-a/nextjs/.devcontainer/Dockerfile create mode 100644 apps/file-q-and-a/nextjs/.devcontainer/devcontainer.json diff --git a/apps/file-q-and-a/nextjs/.devcontainer/Dockerfile b/apps/file-q-and-a/nextjs/.devcontainer/Dockerfile new file mode 100644 index 0000000..4a63dfa --- /dev/null +++ b/apps/file-q-and-a/nextjs/.devcontainer/Dockerfile @@ -0,0 +1,2 @@ +ARG VARIANT=16-bullseye +FROM mcr.microsoft.com/vscode/devcontainers/typescript-node:${VARIANT} \ No newline at end of file diff --git a/apps/file-q-and-a/nextjs/.devcontainer/devcontainer.json b/apps/file-q-and-a/nextjs/.devcontainer/devcontainer.json new file mode 100644 index 0000000..6edb7f7 --- /dev/null +++ b/apps/file-q-and-a/nextjs/.devcontainer/devcontainer.json @@ -0,0 +1,5 @@ +{ + "name": "openai-cookbook file-q-and-a", + "dockerFile": "Dockerfile", + "forwardPorts": [3000] +} \ No newline at end of file diff --git a/apps/file-q-and-a/nextjs/README.md b/apps/file-q-and-a/nextjs/README.md index 92ecab6..0a0703a 100644 --- a/apps/file-q-and-a/nextjs/README.md +++ b/apps/file-q-and-a/nextjs/README.md @@ -10,6 +10,8 @@ To run the app, you need an OpenAI API key. You can create a new API key [here]( If you don't have Node.js and npm already, install them from [https://nodejs.org/en/download/](https://nodejs.org/en/download/). +Otherwise you can run the project inside a [Dev Container](https://code.visualstudio.com/docs/devcontainers/containers). If you are using VS Code, open the Command Pallette (ctrl+shift+p on Windows / cmd+shift+p on Mac), and run the command `Dev Containers: Open Folder in Container`. Then select the folder `apps/file-q-and-a/nextjs`, and VS Code will take care of booting a container with Node.js and npm ready to go. You may need to install the [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. + In your terminal, navigate to the `nextjs` directory of this example app, and then install dependencies: ```