diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a3c33ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM keymetrics/pm2:latest-alpine + +# Bundle APP files +COPY src src/ +COPY package.json . +COPY pm2.json . + +# Install app dependencies +ENV NPM_CONFIG_LOGLEVEL warn +RUN npm install --production +RUN pm2 install pm2-auto-pull + +# Show current folder structure in logs +RUN ls -al -R + +CMD [ "pm2-runtime", "start", "pm2.json" ] diff --git a/pm2.json b/pm2.json new file mode 100644 index 0000000..615aa9f --- /dev/null +++ b/pm2.json @@ -0,0 +1,11 @@ +{ + "name": "upload-api", + "script": "src/index.js", + "instances": "2", + "env": { + "NODE_ENV": "development" + }, + "env_production" : { + "NODE_ENV": "production" + } +} diff --git a/index.js b/src/index.js similarity index 100% rename from index.js rename to src/index.js diff --git a/upload/240f28404d99089db84da454cafa81b1 b/upload/240f28404d99089db84da454cafa81b1 deleted file mode 100644 index 6cf0bb2..0000000 Binary files a/upload/240f28404d99089db84da454cafa81b1 and /dev/null differ diff --git a/upload/48381fba31b4c689073665783d134949 b/upload/48381fba31b4c689073665783d134949 deleted file mode 100644 index 6cf0bb2..0000000 Binary files a/upload/48381fba31b4c689073665783d134949 and /dev/null differ