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,