diff --git a/Dockerfile b/Dockerfile index 27c6bf0..a9a5229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,5 +8,8 @@ CMD node index.js -COPY index.js default_templates package.json package-lock.json ./ +COPY package.json package-lock.json ./ RUN npm i + +COPY index.js ./ +COPY default_templates default_templates diff --git a/Dockerfile b/Dockerfile index 27c6bf0..a9a5229 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,5 +8,8 @@ CMD node index.js -COPY index.js default_templates package.json package-lock.json ./ +COPY package.json package-lock.json ./ RUN npm i + +COPY index.js ./ +COPY default_templates default_templates diff --git a/index.js b/index.js index b3064d8..1e44bbf 100644 --- a/index.js +++ b/index.js @@ -21,9 +21,10 @@ const notify_templates = new Map(); const templatesStat = fs.statSync("templates", {throwIfNoEntry: false}); -if (!templatesStat || fs.readdirSync("templates").length == 0) +if (!templatesStat) fs.mkdirSync("templates"); + +if (fs.readdirSync("templates").length == 0) { - fs.mkdirSync("templates"); for (let filename of fs.readdirSync("default_templates", {encoding:'utf8'})) { fs.copyFileSync(path.join("default_templates", filename), path.join("templates", filename));