feat: add scraper service to all Docker environments

Add eamco_scraper container definitions for dev, local, prod, and
Unraid deployments on port 9519. Remove unused Authorize env_file
references from dev config. Include add_towns.sh helper script for
bootstrapping street reference data.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 17:54:29 -05:00
parent 927cca9db5
commit 9d5c3c72f6
6 changed files with 65 additions and 4 deletions

11
add_towns.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
towns=("Sutton" "Oxford" "North Oxford" "Webster" "Grafton" "Dudley" "Charlton" "Cherry Valley" "Rochdale" "Paxton" "Spencer" "Worcester")
base_url="http://localhost:9618/streets"
state="MA"
for town in "${towns[@]}"; do
encoded_town="${town// /%20}"
echo "Adding $town..."
curl -s -X POST "$base_url/$encoded_town/$state"
echo ""
done

View File

@@ -76,12 +76,8 @@ services:
- ../eamco_authorize:/app - ../eamco_authorize:/app
ports: ports:
- '9516:8000' - '9516:8000'
env_file:
- .env
environment: environment:
- MODE=DEVELOPMENT - MODE=DEVELOPMENT
- AUTHORIZE_API_LOGIN_ID_DEV=${AUTHORIZE_API_LOGIN_ID_DEV}
- AUTHORIZE_TRANSACTION_KEY_DEV=${AUTHORIZE_TRANSACTION_KEY_DEV}
- POSTGRES_USERNAME=postgres - POSTGRES_USERNAME=postgres
- POSTGRES_PW=postgres - POSTGRES_PW=postgres
- POSTGRES_SERVER=postgres_dev - POSTGRES_SERVER=postgres_dev
@@ -112,6 +108,19 @@ services:
- '9618:8000' - '9618:8000'
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000' command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
scraper_dev:
restart: on-failure
build:
context: ../eamco_scraper
dockerfile: Dockerfile.dev
volumes:
- ../eamco_scraper:/app
environment:
- MODE=dev
ports:
- '9619:8000'
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
postgres_dev: postgres_dev:
image: postgres:13 image: postgres:13
restart: always restart: always

View File

@@ -121,3 +121,20 @@ services:
ports: ports:
- '9618:8000' - '9618:8000'
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000' command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'
scraper_local:
restart: on-failure
build:
context: ../eamco_scraper
dockerfile: Dockerfile.local
volumes:
- ../eamco_scraper:/app
environment:
- MODE=LOCAL
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
- POSTGRES_PW=${POSTGRES_PW}
- POSTGRES_SERVER=${POSTGRES_SERVER}
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
ports:
- '9619:8000'
command: 'uvicorn app.main:app --reload --host 0.0.0.0 --port 8000'

View File

@@ -120,3 +120,17 @@ services:
- POSTGRES_DBNAME=${POSTGRES_DBNAME} - POSTGRES_DBNAME=${POSTGRES_DBNAME}
ports: ports:
- '9518:8000' - '9518:8000'
scraper_prod:
restart: on-failure
build:
context: ../eamco_scraper
dockerfile: Dockerfile.prod
environment:
- MODE=PRODUCTION
- POSTGRES_USERNAME=${POSTGRES_USERNAME}
- POSTGRES_PW=${POSTGRES_PW}
- POSTGRES_SERVER=${POSTGRES_SERVER}
- POSTGRES_DBNAME=${POSTGRES_DBNAME}
ports:
- '9519:8000'

View File

@@ -69,3 +69,12 @@ services:
- '9518:8000' - '9518:8000'
env_file: env_file:
- unraid-env - unraid-env
scraper_prod:
restart: on-failure
image: anekdotin/eamco-scraper_prod:latest
ports:
- '9519:8000'
env_file:
- unraid-env
command: 'uvicorn app.main:app --host 0.0.0.0 --port 8000 --workers 2'

View File

@@ -16,6 +16,7 @@ VITE_AUTO_URL="http://192.168.1.204:9514"
VITE_SERVICE_URL="http://192.168.1.204:9515" VITE_SERVICE_URL="http://192.168.1.204:9515"
VITE_AUTHORIZE_URL="http://192.168.1.204:9516" VITE_AUTHORIZE_URL="http://192.168.1.204:9516"
VITE_ADDRESS_CHECKER_URL="http://192.168.1.204:9518" VITE_ADDRESS_CHECKER_URL="http://192.168.1.204:9518"
VITE_SCRAPER_URL="http://192.168.1.204:9519"
# =========================================== # ===========================================
# Database Credentials # Database Credentials