Skip to content

Project NOMAD is an offline-first knowledge and education server. Wikipedia, thousands of books, courses, maps, and optional local AI, all running on hardware you own with no internet required.

TypeScript

fix(OSM): increase memory for import

Jake Turner3dbcd7a7143d
diff --git a/admin/app/services/docker_service.ts b/admin/app/services/docker_service.ts
index ec11e2a8..ebfe4169 100644
--- a/admin/app/services/docker_service.ts
+++ b/admin/app/services/docker_service.ts
@@ -295,7 +295,7 @@ export class DockerService {
* Largely follows the install instructions here: https://github.com/Overv/openstreetmap-tile-server/blob/master/README.md
*/
private async _runPreinstallActions__OpenStreetMap(image: string, containerConfig: any): Promise<void> {
- const OSM_PBF_URL = 'https://download.geofabrik.de/north-america-latest.osm.pbf'; // Download North America latest for initial import
+ const OSM_PBF_URL = 'https://download.geofabrik.de/north-america/us-pacific-latest.osm.pbf'; // Download US Pacific sub-region for initial import
const IMPORT_FILE = 'region.osm.pbf';
const PATH = `${DockerService.NOMAD_STORAGE_DIR}/osm/${IMPORT_FILE}`;
const IMPORT_BIND = `${PATH}:/data/${IMPORT_FILE}:rw`;
@@ -336,6 +336,8 @@ export class DockerService {
Object.assign(configWithImportBind, {
RestartPolicy: { Name: 'no' },
Binds: [...(containerConfig.HostConfig?.Binds || []), IMPORT_BIND],
+ Memory: 4 * 1024 * 1024 * 1024, // 4GB
+ MemorySwap: -1
});
this._broadcast(DockerService.OPENSTREETMAP_IMPORT_SERVICE_NAME, 'importing', `Processing initial import of OSM data. This may take some time...`);