Skip to content

Commit

Permalink
🎨 新增包含redis的镜像
Browse files Browse the repository at this point in the history
  • Loading branch information
xkrfer authored and xkrfer committed Mar 29, 2022
1 parent ab08200 commit 09f26cd
Show file tree
Hide file tree
Showing 23 changed files with 6,594 additions and 5,685 deletions.
17 changes: 10 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ FROM golang AS gorush
WORKDIR /push

RUN git clone https://github.com/appleboy/gorush.git --depth=1 \
&& go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& cd gorush \
&& go install \
&& go build -o ../bin/gorush

FROM node:16.4.2 AS build
FROM node:14.17.6 AS build

WORKDIR /app

COPY package.json /app/

RUN npm install
RUN npm install --registry=https://registry.npmmirror.com

COPY . /app/

RUN npm run build

FROM node:16.4.2-alpine AS release
FROM node:14.17.6-alpine AS release

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

Expand All @@ -31,19 +33,20 @@ COPY --from=gorush /push/bin/gorush /release/push/gorush

COPY package.json /release/

RUN npm install --production \
RUN npm install --registry=https://registry.npmmirror.com --production \
&& apk update \
&& apk upgrade \
&& apk add --no-cache bash bash-doc bash-completion \
&& apk add --no-cache tzdata openrc supervisor libc6-compat\
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& cp supervisord/supervisor.d /etc/supervisor.d \
&& cp supervisord/supervisord.conf /etc/supervisord.conf \
&& chmod 777 /release/supervisord/start.sh \
&& chmod 777 start.sh \
&& chmod 777 /release/push/gorush \
&& rm -rf /var/cache/apk/*
&& rm -rf /var/cache/apk/* \

COPY --from=build /app/dist /release/dist

ENTRYPOINT ["/bin/sh", "/release/supervisord/start.sh"]
ENTRYPOINT ["/bin/sh", "start.sh"]

EXPOSE 8800
47 changes: 47 additions & 0 deletions Dockerfile.node-redis
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
FROM golang AS gorush

WORKDIR /push

RUN git clone https://github.com/appleboy/gorush.git --depth=1 \
&& go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& cd gorush \
&& go install \
&& go build -o ../bin/gorush

FROM node:14.17.6 AS build

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

WORKDIR /app

COPY package.json /app/

RUN npm install --registry=https://registry.npmmirror.com

COPY . /app/

RUN npm run build

FROM xkrfer/node-redis:1.0 AS release

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

WORKDIR /release

COPY docker /release/

COPY --from=gorush /push/bin/gorush /release/push/gorush

COPY package.json /release/

RUN npm install --registry=https://registry.npmmirror.com --production \
&& cp supervisord/supervisor.d/supervisord-clip.ini /etc/supervisor.d/supervisord-clip.ini \
&& cp supervisord/supervisor.d/supervisord-ios.ini /etc/supervisor.d/supervisord-ios.ini

COPY --from=build /app/dist /release/dist

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

EXPOSE 8800
EXPOSE 6379
1 change: 0 additions & 1 deletion docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ services:
- ALLOW_EMPTY_PASSWORD=yes
app:
build: '.'
#image: 'xkrfer/pushdeer-node'
ports:
- '8800:8800'
depends_on:
Expand Down
1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ services:
- ALLOW_EMPTY_PASSWORD=yes
app:
build: '.'
#image: 'xkrfer/pushdeer-node'
ports:
- '8800:8800'
depends_on:
Expand Down
2 changes: 1 addition & 1 deletion docker/push/clip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ core:
enabled: false
path: "gorush.pid"
override: true

api:
push_uri: "/api/push"
stat_go_uri: "/api/stat/go"
Expand Down
1 change: 0 additions & 1 deletion docker/supervisord/start.sh → docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/usr/bin/supervisord -c /etc/supervisord.conf
/bin/bash

node /release/dist/main.js
2 changes: 1 addition & 1 deletion docker/supervisord/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,4 @@ serverurl=unix:///run/supervisord.sock ; use a unix:// URL for a unix socket
; include files themselves.

[include]
files = /release/supervisord/supervisor.d/*.ini
files = /etc/supervisor.d/*.ini
Loading

0 comments on commit 09f26cd

Please sign in to comment.