diff --git a/example/immich.ts b/example/immich.ts index e8a2725..5f8af4d 100644 --- a/example/immich.ts +++ b/example/immich.ts @@ -35,6 +35,14 @@ export function immichStack(props: ImmichStackOptions) { // todo volumes }); + const immichEnv = { + DB_HOSTNAME: database.name, + DB_USERNAME: props.postgres.username, + DB_PASSWORD: props.postgres.password, + DB_DATABASE_NAME: props.postgres.database, + REDIS_HOSTNAME: redis.name, + }; + const immichServer = new Service("immich-server", { image: `ghcr.io/immich-app/immich-server:${ props.immichVersion ?? "release" @@ -43,17 +51,36 @@ export function immichStack(props: ImmichStackOptions) { command: ["start.sh", "immich"], dependsOn: [database, redis], // todo volumes - environment: { - DB_HOSTNAME: database.name, - DB_USERNAME: props.postgres.username, - DB_PASSWORD: props.postgres.password, - DB_DATABASE_NAME: props.postgres.database, - REDIS_HOSTNAME: redis.name, - }, + environment: immichEnv, ports: ["2283:3001"], }); + const immichMicroservices = new Service("immich-microservices", { + image: `ghcr.io/immich-app/immich-server:${ + props.immichVersion ?? "release" + }`, + restart: "unless-stopped", + command: ["start.sh", "microservices"], + dependsOn: [database, redis], + // todo volumes + environment: immichEnv, + }); + + const immichMachineLearning = new Service("immich-machine-learning", { + image: `ghcr.io/immich-app/immich-machine-learning:${ + props.immichVersion ?? "release" + }`, + // todo volumes + environment: immichEnv, + }); + return new Stack("immich", { - services: [redis, database, immichServer], + services: [ + redis, + database, + immichServer, + immichMicroservices, + immichMachineLearning, + ], }); }