mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat(deployment) Allow overriding service host and ports with env variables (#930)
* Add proxy changes * Add web changes * Add microservices changes * Add examples * Add header comment to nginx config * Use URLs instead of host and port
This commit is contained in:
parent
66640ebfeb
commit
f6aba0f9ec
9 changed files with 65 additions and 14 deletions
|
|
@ -9,6 +9,8 @@ import axios from 'axios';
|
|||
import { Job } from 'bull';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
const immich_machine_learning_url = process.env.IMMICH_MACHINE_LEARNING_URL || 'http://immich-machine-learning:3003';
|
||||
|
||||
@Processor(QueueNameEnum.MACHINE_LEARNING)
|
||||
export class MachineLearningProcessor {
|
||||
constructor(
|
||||
|
|
@ -20,9 +22,12 @@ export class MachineLearningProcessor {
|
|||
async tagImage(job: Job<IMachineLearningJob>) {
|
||||
const { asset } = job.data;
|
||||
|
||||
const res = await axios.post('http://immich-machine-learning:3003/image-classifier/tag-image', {
|
||||
thumbnailPath: asset.resizePath,
|
||||
});
|
||||
const res = await axios.post(
|
||||
immich_machine_learning_url + '/image-classifier/tag-image',
|
||||
{
|
||||
thumbnailPath: asset.resizePath,
|
||||
},
|
||||
);
|
||||
|
||||
if (res.status == 201 && res.data.length > 0) {
|
||||
const smartInfo = new SmartInfoEntity();
|
||||
|
|
@ -40,9 +45,12 @@ export class MachineLearningProcessor {
|
|||
try {
|
||||
const { asset }: { asset: AssetEntity } = job.data;
|
||||
|
||||
const res = await axios.post('http://immich-machine-learning:3003/object-detection/detect-object', {
|
||||
thumbnailPath: asset.resizePath,
|
||||
});
|
||||
const res = await axios.post(
|
||||
immich_machine_learning_url + '/object-detection/detect-object',
|
||||
{
|
||||
thumbnailPath: asset.resizePath,
|
||||
},
|
||||
);
|
||||
|
||||
if (res.status == 201 && res.data.length > 0) {
|
||||
const smartInfo = new SmartInfoEntity();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue