Skip to content

Commit

Permalink
Prepare Dockerfile for local env
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvain-morin authored and sylvain-morin committed Aug 9, 2023
1 parent 36db7ea commit d02fe89
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 37 deletions.
6 changes: 4 additions & 2 deletions config.js.ci
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
apiURL: "http://localhost:3000",
currentVersionURL: "http://localhost:4000/v1",
environment: "test",
elasticsearch: {
host: "http://localhost:9200",
geoPointField: "location",
Expand All @@ -10,7 +11,8 @@ module.exports = {
user: "postgres",
host: "127.0.0.1",
port: 5432,
geometry_field: "geom"
geometry_field: "geom",
dbname: "inaturalist_test"
},
websiteURL: "http://localhost:3000/",
staticImagePrefix: "http://localhost:3000/attachments/",
Expand All @@ -24,4 +26,4 @@ module.exports = {
debug: true,
jwtSecret: "secret",
jwtApplicationSecret: "application_secret"
}
}
44 changes: 22 additions & 22 deletions config_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@ const {
INAT_WEB_HOST
} = process.env;
module.exports = {
// Base URL for the current version of *this* app
currentVersionURL: "http://localhost:4000/v1",
// Host running the iNaturalist Rails app
apiURL: INAT_WEB_HOST ? `http://${INAT_WEB_HOST}:3000` : "http://localhost:3000",
jwtSecret: "secret",
jwtApplicationSecret: "application_secret",
tileSize: 512,
debug: true,
// Base URL for the current version of *this* app
currentVersionURL: "http://localhost:4000/v1",
// Whether the Rails app supports SSL requests. For local dev assume it does not
apiHostSSL: false,
writeHostSSL: false,
elasticsearch: {
host: INAT_ES_HOST ? `http://${INAT_ES_HOST}:9200` : "http://localhost:9200",
geoPointField: "location"
},
database: {
user: INAT_DB_USER || "inaturalist",
host: INAT_DB_HOST || "127.0.0.1",
Expand All @@ -24,28 +27,25 @@ module.exports = {
password: INAT_DB_PASS || "inaturalist",
ssl: false
},
staticImagePrefix: "http://localhost:3000/attachments/",
tileSize: 512,
debug: true,
logLevel: "info", // only "debug" does anything right now
websiteURL: "http://localhost:3000/",
staticImagePrefix: "http://localhost:3000/attachments/",
userImagePrefix: "/attachments/users/icons/",
jwtSecret: "secret",
jwtApplicationSecret: "application_secret",
imageProcesing: {
// Base URL for the web app returning computer vision results
tensorappURL: "http://localhost:6006",
// Path to a file listing the taxonomy used in the computer vision model
taxaFilePath: "",
// Path to a directory where uploads should be stored. /tmp/ is fine on most
// *nix systems
uploadsDir: "/tmp/",
// Path to a file listing the taxonomy used in the computer vision model
taxaFilePath: ""
// Base URL for the web app returning computer vision results
tensorappURL: "http://localhost:6006"
},
redis: {
host: INAT_REDIS_HOST || "127.0.0.1",
port: 6379
},
elasticsearch: {
host: INAT_ES_HOST ? `http://${INAT_ES_HOST}:9200` : "http://localhost:9200",
geoPointField: "location"
},
// Whether the Rails app supports SSL requests. For local dev assume it does not
apiHostSSL: false,
writeHostSSL: false,
logLevel: "info", // only "debug" does anything right now
userImagePrefix: "/attachments/users/icons/"
};
}
};
13 changes: 0 additions & 13 deletions lib/es_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,19 +92,6 @@ esClient.searchWithContext = async ( options = { } ) => (
} )
);

esClient.search = async ( index, options = { } ) => (
esClient.connection.search( {
preference: config.elasticsearch.preference,
index: _.map( _.flatten( [index] ), i => esClient.buildIndexName( i ) ),
body: options.body
}, {

context: {
startTime: hrtime.bigint( )
}
} )
);

esClient.search = async ( index, options = { } ) => (
esClient.searchWithContext( {
preference: config.elasticsearch.preference,
Expand Down

0 comments on commit d02fe89

Please sign in to comment.