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 devcontainer file #365

Merged
merged 2 commits into from
May 3, 2024
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
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
Loading