From b6b9cda1149b5b1bca9cb6817c67efb7732db0bc Mon Sep 17 00:00:00 2001 From: Clansty Date: Sat, 5 Mar 2022 20:57:54 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E4=BC=98=E5=8C=96=20docker=20=E9=83=A8?= =?UTF-8?q?=E7=BD=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/main.yml | 9 --------- Dockerfile | 13 +++++++++---- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3f682fb..3376ab3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 diff --git a/Dockerfile b/Dockerfile index 0fcfca4..197270e 100644 --- a/Dockerfile +++ b/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" ]