Skip to content
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
18 changes: 16 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,29 @@ AWS_SECRET_ACCESS_KEY=samplesecretkey
JOIN_RECORD_BUCKET_NAME="meshdb-join-form-log"
JOIN_RECORD_PREFIX="join-form-submissions-dev"


# Used to override the default celery broker port.
# You must uncomment the CELERY_BROKER line below to have this value
# used in django settings
# REDIS_PORT=

# Change to 'redis' when using meshdb in docker-compose.
# Defaults to redis://localhost:6379/0
# CELERY_BROKER=
# CELERY_BROKER="redis://127.0.0.1:${REDIS_PORT:-6379}/0"

# Django secret key see
# https://docs.djangoproject.com/en/6.1/ref/settings/#secret-key
# DO NOT USE THIS KEY IN PRODUCTION
DJANGO_SECRET_KEY=sapwnffdtj@6p)ghfw249dz+@e6f2#i+5gia8*7&nup(szt9hp

# Used to override the port the pelias parser service port
# You must uncomment the PELIAS_ADDRESS_PARSER_URL line below to have
# this value work in django settings
# PELIAS_PORT=

# Change to pelias:3000 when using full docker-compose.
# Defaults to http://localhost:6800/parser/parse
# PELIAS_ADDRESS_PARSER_URL=
# PELIAS_ADDRESS_PARSER_URL="http://127.0.0.1:${PELIAS_PORT:-6800}/parser/parse"

# Secrets for the legacy forms endpoints
NN_ASSIGN_PSK=localdev
Expand Down
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ To start contributing, find a [good first issue](https://github.com/nycmeshnet/m
- [Pelias](https://pelias.io/)
- [Redis](https://redis.io)

We have a handy [docker-compose](docker-compose.yaml) file that allows you to set all the external services up with a single command. See
We have a handy [compose.yaml](compose.yaml) file that allows you to
set up all the external services with a single command. See
[Setting up the required external services](#setting-up-the-required-external-services)

> [!NOTE]
Expand Down Expand Up @@ -80,12 +81,14 @@ uv sync --all extras

### Set Environment Variables

Next, copy the out the `.env.sample` file to `.env` and load it into
your environment.
Next, copy the [`.env.sample`](.env.sample) file to `.env` and make any
changes you'd like to make. The settings in `.env.sample` are generally
good to go out of the box, you may need to change port numbers if
you're running existing services on the ports set in the sample file.

```console
cp .env.sample .env
nano .env # Or your favorite text editor, fill in the blank variables
nano .env # Or your favorite text editor make any changes
```

You're gonna need a `DJANGO_SECRET_KEY`, one is already provided in the
Expand All @@ -94,7 +97,7 @@ below.

### Generating `DJANGO_SECRET_KEY` (optional)

There's already a secret key for you in the .env.sample, but here's how
There's already a secret key for you in `.env.sample`, but here's how
to generate a new one

```python
Expand All @@ -108,7 +111,7 @@ uv run python -c 'from django.core.management.utils import get_random_secret_key
### Setting up the required external services

You will need the services identified in [External Services](#external-services)
which have been pre-defined in docker compose
which have been pre-defined in the compose.yaml file.

```console
docker compose up -d postgres pelias redis
Expand Down Expand Up @@ -290,7 +293,7 @@ When you're done, you can stop the server with `Ctrl+C`, and run
> To spin things back up again later, just run:
>
> ```console
> docker-compose up -d postgres pelias redis
> docker compose up -d postgres pelias redis
> uv run python src/manage.py runserver
> ```

Expand Down
6 changes: 3 additions & 3 deletions docker-compose.yaml → compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
networks:
- api
ports:
- 5432:5432
- "127.0.0.1:${DB_PORT:-5432}:5432"
image: docker.io/postgres:17.11-trixie
environment:
POSTGRES_DB: ${DB_NAME}
Expand All @@ -32,14 +32,14 @@ services:
image:
docker.io/redis
ports:
- 6379:6379
- "127.0.0.1:${REDIS_PORT:-6379}:6379"

pelias:
container_name: meshdb-pelias-1
networks:
- api
ports:
- 6800:3000
- "127.0.0.1:${PELIAS_PORT:-6800}:3000"
image: docker.io/pelias/parser

meshdb:
Expand Down
Loading