Skip to content

Commit

Permalink
allow us to set the OSRM data location
Browse files Browse the repository at this point in the history
also don't copy into the dist folder any more.  let data stay separate
  • Loading branch information
srkirkland committed Jan 27, 2025
1 parent aba239e commit 1b928eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# Copy OSRM data from previous stage into newly created dist folder (where we run the app)
COPY --from=osrm-processor /app/data ./dist/data
COPY --from=osrm-processor /app/data ./data

EXPOSE 3000
CMD ["npm", "start"]
6 changes: 3 additions & 3 deletions index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import OSRM from '@project-osrm/osrm';
import { performance } from 'perf_hooks';
import pg, { Connection } from 'pg';
import swaggerUi from 'swagger-ui-express';
import saveModels from './saveModels'
import saveUserDetails from './saveUserDetails'
import saveModels from './saveModels';
import saveUserDetails from './saveUserDetails';

import { getFrcsInputsTest } from './frcsInputCalculations';
import { setupAppInsights, trackMetric } from './logging';
Expand Down Expand Up @@ -75,7 +75,7 @@ hookupKnexTiming(db);

console.log('connected to db. connecting to osrm...');

const osrm = new OSRM('./data/california-latest.osrm');
const osrm = new OSRM(process.env.OSRM_FILE || './data/california-latest.osrm');
console.log('connected to osrm');

// allow cors
Expand Down

0 comments on commit 1b928eb

Please # to comment.