mirror of https://github.com/Nofated095/Q2TG.git
fix: 优化 docker 部署
This commit is contained in:
parent
b6b9cda114
commit
b9bf2a12ba
25
Dockerfile
25
Dockerfile
|
@ -2,24 +2,35 @@ FROM jrottenberg/ffmpeg:4.1-alpine AS ffmpeg
|
|||
|
||||
FROM ghcr.io/clansty/tgs-to-gif:latest AS tgs
|
||||
|
||||
FROM node:17-alpine AS build
|
||||
FROM node:17-alpine AS deps
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json yarn.lock .yarnrc.yml ./
|
||||
COPY .yarn/ ./.yarn/
|
||||
|
||||
RUN apk add --no-cache --virtual .build-deps alpine-sdk python3 &&\
|
||||
yarn install &&\
|
||||
apk del .build-deps
|
||||
RUN apk add --no-cache alpine-sdk python3 &&\
|
||||
yarn install
|
||||
|
||||
FROM node:17-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=deps /app/ /app/
|
||||
|
||||
COPY tsconfig.json ./
|
||||
COPY src/ ./src/
|
||||
|
||||
RUN yarn build
|
||||
|
||||
FROM node:17-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=ffmpeg / /
|
||||
COPY --from=tgs / /
|
||||
COPY --from=build /app/ /app/
|
||||
|
||||
COPY --from=deps /app/ /app/
|
||||
COPY prisma/ ./prisma/
|
||||
COPY build/ ./build/
|
||||
COPY --from=build /app/build/ /app/build/
|
||||
|
||||
CMD [ "yarn", "start" ]
|
||||
|
|
Loading…
Reference in New Issue