diff --git a/Dockerfile b/Dockerfile index d2a9ba3..d616572 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,4 +15,6 @@ COPY --chown=node:node ["src", "./src"] RUN npm pkg delete scripts.prepare \ && npm ci --omit=dev COPY --from=google/shaka-packager:v3.2.0 /usr/bin/packager /usr/bin/packager +ENV STAGING_DIR=/data +VOLUME [ "/data" ] CMD [ "npm", "run", "start", "--", "-r" ] diff --git a/src/config.ts b/src/config.ts index 56315b1..7390dfd 100644 --- a/src/config.ts +++ b/src/config.ts @@ -24,6 +24,7 @@ export interface PackagingConfig { packageListenerPlugin?: string; encorePassword?: string; oscAccessToken?: string; + stagingDir?: string; } function readRedisConfig(): RedisConfig { @@ -42,7 +43,8 @@ function readPackagingConfig(): PackagingConfig { concurrency: parseInt(process.env.PACKAGE_CONCURRENCY || '1'), packageListenerPlugin: process.env.PACKAGE_LISTENER_PLUGIN, encorePassword: process.env.ENCORE_PASSWORD, - oscAccessToken: process.env.OSC_ACCESS_TOKEN + oscAccessToken: process.env.OSC_ACCESS_TOKEN, + stagingDir: process.env.STAGING_DIR }; } diff --git a/src/encorePackager.ts b/src/encorePackager.ts index 50fc45f..60d303a 100644 --- a/src/encorePackager.ts +++ b/src/encorePackager.ts @@ -47,7 +47,8 @@ export class EncorePackager { source: this.config.oscAccessToken ? new URL(jobUrl).origin : undefined, serviceAccessToken, noImplicitAudio: true, - shakaExecutable: this.config.shakaExecutable + shakaExecutable: this.config.shakaExecutable, + stagingDir: this.config.stagingDir } as PackageOptions); console.log(`Finished packaging of job ${job.id} to output folder ${dest}`); } @@ -109,9 +110,7 @@ export function parseInputsFromEncoreJob(job: EncoreJob) { throw new Error('Encore job has no output'); } const video = job.output - .filter( - (output) => output.type === 'VideoFile' - ) + .filter((output) => output.type === 'VideoFile') .map((output) => ({ output, videoStream: output.videoStreams?.[0] })); const audio = job.output .filter((output) => output.type === 'AudioFile')