diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000000000..6975847ed5aa22 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,10 @@ +node_modules +npm-debug.log +Dockerfile* +docker-compose* +.dockerignore +.git +.gitignore +README.md +LICENSE +.vscode \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000000..275be4503cd378 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM keymetrics/pm2:8-alpine +ENV NODE_ENV production +WORKDIR /usr/src/app +COPY ["package.json", "./"] +RUN yarn --prod -s && mv node_modules ../ +COPY . . +EXPOSE 1200 +CMD pm2-runtime start process.json \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000000000..20fe1608129e6c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '2.1' + +services: + rsshub: + image: rsshub + container_name: rsshub + build: . + environment: + NODE_ENV: production + ports: + - 1200:1200 diff --git a/process.json b/process.json new file mode 100644 index 00000000000000..2b6678bb5a7f8f --- /dev/null +++ b/process.json @@ -0,0 +1,11 @@ +{ + "apps": [{ + "name": "rsshub", + "script": "index.js", + "instances": "max", + "exec_mode": "cluster", + "env": { + "NODE_ENV": "production" + } + }] +} \ No newline at end of file