Spaces:
Running
Running
FROM node:18-alpine AS base | |
FROM base AS deps | |
RUN apk add --no-cache libc6-compat | |
WORKDIR /app | |
COPY package.json yarn.lock* package-lock.json* ./ | |
RUN \ | |
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ | |
elif [ -f package-lock.json ]; then npm ci; \ | |
else echo "Lockfile not found." && exit 1; \ | |
fi | |
FROM base AS builder | |
RUN apk update && apk add --no-cache git | |
ENV OPENAI_API_KEY="" | |
ENV COOKIES="" | |
ENV CODE="" | |
ARG DOCKER=true | |
WORKDIR /app | |
COPY --from=deps /app/node_modules ./node_modules | |
COPY . . | |
RUN yarn build | |
FROM base AS runner | |
WORKDIR /app | |
ENV OPENAI_API_KEY="" | |
ENV COOKIES="" | |
ENV CODE="" | |
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 | |
EXPOSE 3000 | |
CMD ["node","server.js"] | |