mirror of https://github.com/Nofated095/Q2TG.git
perf: 优化 docker 部署
This commit is contained in:
parent
e6ffd253a5
commit
b6b9cda114
|
@ -12,15 +12,6 @@ jobs:
|
|||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js environment
|
||||
uses: actions/setup-node@v2.3.0
|
||||
with:
|
||||
cache: yarn
|
||||
|
||||
- run: yarn install
|
||||
|
||||
- run: yarn build
|
||||
|
||||
- name: OCI meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v3
|
||||
|
|
13
Dockerfile
13
Dockerfile
|
@ -2,19 +2,24 @@ FROM jrottenberg/ffmpeg:4.1-alpine AS ffmpeg
|
|||
|
||||
FROM ghcr.io/clansty/tgs-to-gif:latest AS tgs
|
||||
|
||||
FROM node:17-alpine
|
||||
COPY --from=ffmpeg / /
|
||||
COPY --from=tgs / /
|
||||
FROM node:17-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
COPY .yarn/ ./.yarn/
|
||||
COPY prisma/ ./prisma/
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps alpine-sdk python3 &&\
|
||||
yarn install &&\
|
||||
apk del .build-deps
|
||||
|
||||
FROM node:17-alpine
|
||||
|
||||
COPY --from=ffmpeg / /
|
||||
COPY --from=tgs / /
|
||||
COPY --from=build /app/ /app/
|
||||
|
||||
COPY prisma/ ./prisma/
|
||||
COPY build/ ./build/
|
||||
|
||||
CMD [ "yarn", "start" ]
|
||||
|
|
Loading…
Reference in New Issue