Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dev container #519

Merged
merged 6 commits into from
Oct 23, 2023
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
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",
jeromehardaway marked this conversation as resolved.
Show resolved Hide resolved
"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],
jeromehardaway marked this conversation as resolved.
Show resolved Hide resolved
"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
jeromehardaway marked this conversation as resolved.
Show resolved Hide resolved

# 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