Skip to content

Commit

Permalink
chore: init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lizheming committed Jan 9, 2022
1 parent f00ca18 commit 1f6e376
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://github.com/nodejs/LTS
FROM node:lts AS build
WORKDIR /app
ENV NODE_ENV production
COPY package.json /app/package.json
RUN set -eux; \
npm install --production

FROM node:lts-alpine
WORKDIR /app
ENV TZ Asia/Shanghai
ENV NODE_ENV production
RUN set -eux; \
apk add --no-cache bash; \
apk add --no-cache --virtual .build-deps alpine-conf; \
setup-timezone -z ${TZ}; \
apk del --no-network .build-deps
COPY --from=build /app .
COPY index.js /app/index.js
EXPOSE 3000
CMD ["node", "index.js"]
9 changes: 9 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const Waline = require('@waline/vercel');

const app = Waline({
async postSave(comment) {
// do what ever you want after save comment
},
});

require('http').createServer(app).listen(process.env.PORT || 3000);
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "railway-starter",
"private": true,
"version": "0.0.0-development",
"description": "An Waline starter repository for deploy to Railway.app",
"main": "index.js",
"repository": {
"type": "git",
"url": "git+https://github.com/walinejs/railway-starter.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"bugs": {
"url": "https://github.com/walinejs/railway-starter/issues"
},
"homepage": "https://github.com/walinejs/railway-starter#readme",
"dependencies": {
"@waline/vercel": "^1.5.0"
}
}

0 comments on commit 1f6e376

Please sign in to comment.