Skip to content

Commit

Permalink
use host.docker.internal and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
johnclary committed Nov 19, 2024
1 parent 0edc662 commit 0194b64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions etl/moped_projects/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,22 @@ This ETL generates a lookup table of [Moped](https://github.com/cityofaustin/atd
`moped_project_components_spatial_join.py` buffers the project geometry (points and lines) to a distance of 40 feet
then spatially joins the crashes that are inside of that polygon.

## Docker
## Quick start

It is recommended to run this script using the docker container. You can build it using:

Note, if you are on Apple Silicon you may need to add `--platform linux/amd64` to get GDAL to install correctly.

```
docker build . -t atddocker/vz-moped-join
docker build . -t atddocker/vz-moped-join:development
```

Copy the `env_template` template into your own `env_file` and fill in values. Now you can run the script

```
docker run -it --rm --network host --env-file env_file atddocker/vz-moped-join /bin/bash
python moped_project_components_spatial_join.py
docker run -it --rm --env-file env_file atddocker/vz-moped-join python moped_project_components_spatial_join.py
```

## Docker Image CI

The docker image will be rebuilt and pushed to Docker Hub whenever a file in this directory is updated and merged to `main` or `prod`.
2 changes: 1 addition & 1 deletion etl/moped_projects/env_template
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ MOPED_HASURA_ENDPOINT=

# Vision Zero Hasura
VZ_HASURA_ADMIN_SECRET=hasurapassword
VZ_HASURA_ENDPOINT=http://localhost:8084/v1/graphql
VZ_HASURA_ENDPOINT=http://host.docker.internal:8084/v1/graphql

0 comments on commit 0194b64

Please sign in to comment.