Skip to content

Commit

Permalink
Add dev container (#519)
Browse files Browse the repository at this point in the history
* Added dev container setup

* add dev container

* update readme

* add changed dockerfile

* fix PATH in Dockerfile

* Update README.md

---------

Co-authored-by: Jerome Hardaway <[email protected]>
  • Loading branch information
jeromehardaway and Jerome Hardaway authored Oct 23, 2023
1 parent bc3db7e commit ca00b39
Show file tree
Hide file tree
Showing 5 changed files with 21,991 additions and 618 deletions.
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Vets-Who-Code",
"image": "vets-who-code:latest",
"workspaceFolder": "/src",
"mounts": [
"source=${localWorkspaceFolder},target=/src,type=bind,consistency=cached",
"source=node_modules,target=/src/node_modules,type=volume"
],
"customizations": {
"vscode": {
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},
"extensions": [
"dbaeumer.vscode-eslint",
"ms-vscode.vscode-typescript-tslint-plugin"
]
}
},
"forwardPorts": [3000],
"postCreateCommand": "npm install"
}
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM node:18

# Set working directory
WORKDIR /src

# Install dependencies
COPY package*.json ./
RUN npm install

# Add node_modules bin to PATH
ENV PATH /src/node_modules/.bin:$PATH
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,38 @@ $ npm run dev

And boom! Navigate to `http://localhost:3000/` to see the app.

## Development using Dev Container (Optional) 🐳

We have a development container to help you quickly set up your dev environment. This is completely optional but can make getting started easier.

### Requirements

- [Docker](https://www.docker.com/products/docker-desktop)
- [VS Code](https://code.visualstudio.com/)
- [Remote - Containers extension for VS Code](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)

### Steps

1. **Clone the repository**
```sh
git clone https://github.com/Vets-Who-Code/vets-who-code-app.git
cd vets-who-code-app
```

2. **Open in VS Code**
- Open the root directory in VS Code.
- A notification will appear asking if you would like to reopen the project in a dev container. Choose "Reopen in Container".
- If you don't see the notification, open the Command Palette (`F1`) and run `Remote-Containers: Reopen in Container`.
3. **Wait for the Build**
- The dev container will build based on the `Dockerfile` and `devcontainer.json` configuration. This may take a few minutes the first time.
4. **Start Developing**
- After the container is built, VS Code will attach to it. You're now developing inside the container!

Remember, this is optional. If you prefer to set up your development environment manually, you can continue to do so.


## Contributing :handshake:

We love contributions! Please read our [Contributing Guidelines](https://github.com/Vets-Who-Code/vwc-site/blob/master/.github/contributing.md) to get started.
Expand Down
Loading

1 comment on commit ca00b39

@vercel
Copy link

@vercel vercel bot commented on ca00b39 Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.