From 043058971764895ef5776c005c1cefb763cd1875 Mon Sep 17 00:00:00 2001 From: Gregor Date: Wed, 6 Mar 2019 14:43:50 -0800 Subject: [PATCH] fix(Dockerfile): copy `tweets/README.md` for initial setup --- Dockerfile | 6 +++++- lib/push/setup.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index eab1bd07..486bf1a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,10 @@ LABEL "maintainer"="Gregor Martynus (https://github.com/gr2m)" COPY package*.json ./ RUN npm ci --only=production -# start +# copy required files COPY lib . +RUN mkdir tweets +COPY tweets/README.md tweets/ + +# start ENTRYPOINT ["node", "/index.js"] diff --git a/lib/push/setup.js b/lib/push/setup.js index 9472b6a8..d15ecc5b 100644 --- a/lib/push/setup.js +++ b/lib/push/setup.js @@ -38,7 +38,7 @@ async function setup (state) { // Create tweets/README.md file // https://developer.github.com/v3/repos/contents/#create-a-file - const readmeContent = await fs.readFile(`tweets/README.md`) + const readmeContent = await fs.readFile('/tweets/README.md') await request('PUT /repos/:owner/:repo/contents/:path', { owner: payload.repository.owner.login, repo: payload.repository.name,