Skip to content

Commit

Permalink
Add devcontainer file (#365)
Browse files Browse the repository at this point in the history
* Add devcontainr

* readme
  • Loading branch information
james-otten authored May 3, 2024
1 parent 6074394 commit 25ac3c8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"image": "docker.io/python:3.11-bookworm",
"runArgs": [
"--network=host",
],
"postStartCommand": "pip install -e '.[dev]'"
}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -176,5 +176,3 @@ loadenv.sh
# Spreadsheet data
spreadsheet_data

# vs code
.devcontainer.json
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,19 @@ Firstly, fork this repo.
> git remote add upstream https://github.com/nycmeshnet/meshdb
> ```
For safety, create a venv
#### Dev Container
If you would like to develop in a [Dev Container](https://code.visualstudio.com/docs/devcontainers/containers)
1. Make sure you have VS Code installed.
2. Install the Dev Containers extension: `ms-vscode-remote.remote-containers`
3. [Open the repo folder in the container](https://code.visualstudio.com/docs/devcontainers/containers#_quick-start-open-an-existing-folder-in-a-container).
4. In a different shell, outside of VS Code, start the other containers: `docker compose up -d postgres pelias redis` (as below).
5. Continue on the VS Code terminal (where your project is opened) follow normal developer setup.
#### Host
If you are not using a Dev Container, for safety, create a venv
```
python --version # Make sure this is python 3.11.x before continuing
Expand All @@ -48,6 +60,8 @@ Then, install dependencies.
pip install -e '.[dev]'
```
### Set Environment Variables
Next, fill out the `.env.sample` file and load it into your environment.
```
Expand Down

0 comments on commit 25ac3c8

Please sign in to comment.