Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Aug 26, 2024
1 parent 2500da2 commit 88b393a
Show file tree
Hide file tree
Showing 6 changed files with 201 additions and 5 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,3 @@ trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
4 changes: 3 additions & 1 deletion app/Services/Nominatim.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public static function search(string $query, int $limit = 5): Collection
->query($query)
->limit($limit);

return collect($nominatim->find($request));
return collect(
rescue(fn () => $nominatim->find($request))
);
}
}
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"laravel/tinker": "^2.8",
"league/flysystem-aws-s3-v3": "^3.28",
"matanyadaev/laravel-eloquent-spatial": "^4.2",
"meilisearch/meilisearch-php": "^1.9",
"phpoffice/phpspreadsheet": "^1.29",
"pxlrbt/filament-excel": "^2.1",
"spatie/laravel-permission": "^5.11",
Expand Down
148 changes: 147 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions database/seeders/DatabaseSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use App\Models\ServiceType;
use App\Models\User;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Artisan;

class DatabaseSeeder extends Seeder
{
Expand Down Expand Up @@ -80,5 +81,7 @@ public function run(): void
$issue->issueTypes()->attach($issueType->id, ['value' => ['test' => 'test']]);
}
}

Artisan::call('scout:import', ['model' => Point::class]);
}
}
47 changes: 47 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
services:
meilisearch:
image: 'getmeili/meilisearch:latest'
ports:
- '${FORWARD_MEILISEARCH_PORT:-7700}:7700'
environment:
MEILI_NO_ANALYTICS: '${MEILISEARCH_NO_ANALYTICS:-false}'
volumes:
- 'sail-meilisearch:/meili_data'
healthcheck:
test:
- CMD
- wget
- '--no-verbose'
- '--spider'
- 'http://127.0.0.1:7700/health'
retries: 3
timeout: 5s

nominatim:
image: mediagis/nominatim:4.4
ports:
- '${FORWARD_NOMINATIM_PORT:-8080}:8080'
environment:
PBF_URL: 'https://download.geofabrik.de/europe/romania-latest.osm.pbf'
REPLICATION_URL: 'https://download.geofabrik.de/europe/romania-updates'
REPLICATION_UPDATE_INTERVAL: 86400
REPLICATION_RECHECK_INTERVAL: 900
UPDATE_MODE: catch-up

POSTGRES_SHARED_BUFFERS: '2GB'
POSTGRES_MAINTAINENCE_WORK_MEM: '10GB'
POSTGRES_AUTOVACUUM_WORK_MEM: '2GB'
POSTGRES_WORK_MEM: '50MB'
POSTGRES_EFFECTIVE_CACHE_SIZE: '24GB'
POSTGRES_SYNCHRONOUS_COMMIT: 'off'
POSTGRES_MAX_WAL_SIZE: '1GB'
POSTGRES_CHECKPOINT_TIMEOUT: '10min'
POSTGRES_CHECKPOINT_COMPLETITION_TARGET: '0.9'
volumes:
- 'sail-nominatim:/var/lib/postgresql/14/main'

volumes:
sail-meilisearch:
driver: local
sail-nominatim:
driver: local

0 comments on commit 88b393a

Please sign in to comment.