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
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
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
|
- name: OCI meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v3
|
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 ghcr.io/clansty/tgs-to-gif:latest AS tgs
|
||||||
|
|
||||||
FROM node:17-alpine
|
FROM node:17-alpine AS build
|
||||||
COPY --from=ffmpeg / /
|
|
||||||
COPY --from=tgs / /
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json yarn.lock .yarnrc.yml ./
|
COPY package.json yarn.lock .yarnrc.yml ./
|
||||||
COPY .yarn/ ./.yarn/
|
COPY .yarn/ ./.yarn/
|
||||||
COPY prisma/ ./prisma/
|
|
||||||
|
|
||||||
RUN apk add --no-cache --virtual .build-deps alpine-sdk python3 &&\
|
RUN apk add --no-cache --virtual .build-deps alpine-sdk python3 &&\
|
||||||
yarn install &&\
|
yarn install &&\
|
||||||
apk del .build-deps
|
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/
|
COPY build/ ./build/
|
||||||
|
|
||||||
CMD [ "yarn", "start" ]
|
CMD [ "yarn", "start" ]
|
||||||
|
|
Loading…
Reference in New Issue