Skip to content

Commit

Permalink
feat: simplify Dockerfile and reduce image size
Browse files Browse the repository at this point in the history
  • Loading branch information
DDDDD12138 committed Sep 21, 2024
1 parent 5387990 commit f0ab9c2
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
FROM node:20-alpine AS base
FROM node:18-alpine AS base

FROM base AS builder

ENV OPENAI_API_KEY=""
ENV GOOGLE_API_KEY=""
ENV CODE=""

# if you located in China, you can use taobao registry to speed up
# RUN npm config set registry 'https://registry.npmmirror.com/'

RUN npm install -g pnpm@latest-9

FROM base AS deps

WORKDIR /app

COPY .npmrc package.json pnpm-lock.yaml ./

RUN pnpm install
RUN pnpm install --frozen-lockfile

FROM base AS builder

ENV OPENAI_API_KEY=""
ENV GOOGLE_API_KEY=""
ENV CODE=""

WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .

RUN pnpm build

FROM base AS runner

WORKDIR /app

RUN apk add proxychains-ng
RUN apk add --no-cache proxychains-ng

ENV PROXY_URL=""
ENV OPENAI_API_KEY=""
Expand Down

0 comments on commit f0ab9c2

Please sign in to comment.