Skip to content

Commit

Permalink
🎨 预备在railway使用的镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
xkrfer committed May 29, 2022
1 parent 319a1b9 commit 4caf488
Show file tree
Hide file tree
Showing 5 changed files with 2,122 additions and 1 deletion.
46 changes: 46 additions & 0 deletions Dockerfile.railway
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM node:14.17.6 AS build

WORKDIR /app

COPY package.json .

RUN npm install

COPY . .

RUN npm run build

FROM node:14.17.6-alpine AS release

LABEL maintainer="xkrfer <[email protected]>"

WORKDIR /release

COPY docker .

COPY package.json .

RUN npm install --production \
&& npm install -g pm2 \
&& echo "http://dl-cdn.alpinelinux.org/alpine/v3.14/main/" > /etc/apk/repositories \
&& apk update \
&& apk upgrade \
&& apk add --no-cache openrc\
&& apk add --no-cache bash bash-doc bash-completion \
&& apk add --no-cache tzdata openrc libc6-compat\
&& apk add --no-cache redis \
&& cp redis.conf /usr/bin/redis.conf \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& wget https://github.com/appleboy/gorush/releases/download/v1.15.0/gorush-v1.15.0-linux-amd64 -O /release/push/gorush \
&& chmod +x /release/push/gorush \
&& chmod +x start.sh \
&& rm -rf /var/cache/apk/*

COPY --from=build /app/dist dist

COPY static static

EXPOSE 8800

ENTRYPOINT ["/bin/sh", "start.sh", "railway"]

File renamed without changes.
18 changes: 18 additions & 0 deletions docker/push/railway.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
apps: [
{
name: 'redis',
script: '/usr/bin/redis-server'
},
{
name: 'ios-push-notifications',
script: './gorush',
args: '-c ios.yml',
},
{
name: 'clip-push-notifications',
script: './gorush',
args: '-c clip.yml',
},
],
};
Loading

0 comments on commit 4caf488

Please sign in to comment.