init: reinitialize from gin-template

This commit is contained in:
JustSong
2022-11-11 15:35:02 +08:00
parent 4063fe8c31
commit f1d5d9c8d1
129 changed files with 5629 additions and 2629 deletions
+18 -6
View File
@@ -1,13 +1,25 @@
FROM node:16 as builder
WORKDIR /build
COPY . .
COPY ./web .
RUN npm install
RUN npm run build
FROM golang AS builder2
ENV GO111MODULE=on \
CGO_ENABLED=1 \
GOOS=linux \
GOARCH=amd64
FROM node:16-alpine
WORKDIR /build
COPY --from=builder /build /build
RUN npm install sqlite3@5.0.2 # https://github.com/TryGhost/node-sqlite3/issues/1581
RUN npm install pm2 -g
COPY . .
COPY --from=builder /build/build ./web/build
RUN go mod download
RUN go build -ldflags "-s -w" -o message-pusher
FROM scratch
ENV PORT=3000
COPY --from=builder2 /build/message-pusher /
EXPOSE 3000
CMD ["pm2-runtime", "app.js"]
ENTRYPOINT ["/message-pusher"]