Add Dockerfile

This commit is contained in:
Max Isom 2020-03-17 12:30:27 -05:00
parent 426d0b0335
commit 1a1bdfd674
6 changed files with 55 additions and 28 deletions

View file

@ -1,5 +1,6 @@
import Spotify from 'spotify-web-api-node';
import makeDir from 'make-dir';
import path from 'path';
import container from './inversify.config';
import {TYPES} from './types';
import Bot from './bot';
@ -16,6 +17,7 @@ const spotify = container.get<Spotify>(TYPES.Lib.Spotify);
// Create data directories if necessary
await makeDir(container.get(TYPES.Config.DATA_DIR));
await makeDir(container.get(TYPES.Config.CACHE_DIR));
await makeDir(path.join(container.get(TYPES.Config.CACHE_DIR), 'tmp'));
await sequelize.sync({});

View file

@ -140,7 +140,7 @@ export default class {
}
private getCachedPathTemp(url: string): string {
return path.join('/tmp', hasha(url));
return path.join(this.cacheDir, 'tmp', hasha(url));
}
private async isCached(url: string): Promise<boolean> {