From ab20571e3f2bd6bcaa81285821cba0e38746b677 Mon Sep 17 00:00:00 2001 From: tycrek Date: Tue, 13 Jul 2021 23:27:57 -0600 Subject: [PATCH] more docker "attempts" at "fixes" and "stuff like "that"" --- ass.js | 5 +++-- compose.yaml | 32 +++++++++++++++++++------------- 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/ass.js b/ass.js index 9907384..10fa947 100755 --- a/ass.js +++ b/ass.js @@ -99,7 +99,8 @@ log .blank() .callback(() => { if (process.argv[2] && process.argv[2] === '--docker-compose') - log.info('docker-compose', 'Exiting in 5 seconds...') - .callback(() => setTimeout(() => process.exit(0), 5000)) + fs.ensureDir(require('path').join(process.cwd(), 'share')).then(() => log + .info('docker-compose', 'Exiting in 5 seconds...') + .callback(() => setTimeout(() => process.exit(0), 5000))) }) .express().Host(app, port, host, () => log.success('Ready for uploads', `Storing resources ${s3enabled ? 'in S3' : 'on disk'}`)); diff --git a/compose.yaml b/compose.yaml index 7d8bc74..df46046 100644 --- a/compose.yaml +++ b/compose.yaml @@ -13,22 +13,28 @@ services: - "40115:40115" - "45375:45375" volumes: - - type: bind - source: /opt/ass/uploads + - type: bind # default local file storage + source: ./uploads target: /opt/ass/uploads - - type: bind - source: /opt/ass/config.json + - type: bind # config data + source: ./config.json target: /opt/ass/config.json - - type: bind - source: /opt/ass/auth.json + - type: bind # user data + source: ./auth.json target: /opt/ass/auth.json - - type: bind - source: /opt/ass/data.json + - type: bind # file data (for the default JSONStorageEngine) + source: ./data.json target: /opt/ass/data.json - tmpfs: /tmp - working_dir: /opt/ass + - type: bind # share directory (for future use) + source: ./share + target: /opt/ass/share + bind: + create_host_path: true + tmpfs: /tmp # temp files such as uploads are stored here + working_dir: /opt/ass # this is where the ass files are located within the container tty: true environment: - - NODE_ENV=production - - ASS_ENV=docker - - FORCE_COLOR=3 \ No newline at end of file + - NODE_ENV=production # for production + - ASS_ENV=docker # docker, local, production (not widely used yet) + - LOG_LEVEL=debug # debug, info, warn, error + - FORCE_COLOR=3 # force colour output \ No newline at end of file