Skip to content

Commit

Permalink
feat: docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
Licoy committed Sep 3, 2023
1 parent 0bb5707 commit fd7f277
Showing 1 changed file with 9 additions and 29 deletions.
38 changes: 9 additions & 29 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,42 +1,22 @@
FROM node:18-alpine AS base

FROM base AS deps

RUN apk add --no-cache libc6-compat

WORKDIR /app

COPY package.json yarn.lock ./

RUN yarn config set registry 'https://mirrors.cloud.tencent.com/npm/'
RUN yarn install

FROM base AS builder

RUN apk update && apk add --no-cache git
FROM base AS build

WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm install pnpm -g
RUN pnpm i
RUN pnpm run build

RUN yarn build
FROM base AS final

FROM base AS runner
WORKDIR /app

RUN apk add proxychains-ng

ENV PROXY_URL=""
ENV OPENAI_API_KEY=""
ENV CODE=""
ENV MJ_SERVER_ID=""
ENV MJ_CHANNEL_ID=""
ENV MJ_USER_TOKEN=""

COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/.next/server ./.next/server
COPY --from=build /app/public ./public
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static
COPY --from=build /app/.next/server ./.next/server

EXPOSE 3000

Expand Down

0 comments on commit fd7f277

Please sign in to comment.