diff --git a/Dockerfile b/Dockerfile index a0dc037..71c6244 100644 --- a/Dockerfile +++ b/Dockerfile @@ -43,6 +43,8 @@ ENV BITCOIN_PRICE_URL="https://api.kraken.com/0/public/Ticker?pair=xbtusd" ENV BITCOIN_PRICE_JSON_PATH="result.XXBTZUSD.c[0]" ENV BITCOIN_PAYEE_NAME="Bitcoin Price Change" +VOLUME ./cache + # Copy the current directory contents into the container at /usr/src/app COPY --chown=node:node . . diff --git a/track-investments.js b/track-investments.js index 539a522..19e5ed5 100644 --- a/track-investments.js +++ b/track-investments.js @@ -22,7 +22,8 @@ const getCredentials = async () => { const pw = auth.split(':')[1]; const data = `${username}:${pw}`; - fs.writeFileSync('simplefin.credentials', data); + const cache = process.env.ACTUAL_CACHE_DIR || './cache'; + fs.writeFileSync(cache + '/simplefin.credentials', data); console.log('SimpleFIN credentials:', data); return data; };