perf: 优化 docker 部署

This commit is contained in:
Clansty 2022-03-05 20:57:54 +08:00
parent e6ffd253a5
commit b6b9cda114
No known key found for this signature in database
GPG Key ID: 05F8479BA63A8E92
2 changed files with 9 additions and 13 deletions

View File

@ -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

View File

@ -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" ]