-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |