|
|
|
FROM node:20-alpine AS base |
|
ENV PNPM_HOME="/pnpm" |
|
ENV PATH="$PNPM_HOME:$PATH" |
|
|
|
|
|
RUN npm i -g pnpm |
|
|
|
|
|
FROM base AS clone |
|
WORKDIR /usr/src/app |
|
RUN apk add --no-cache git |
|
RUN git clone https://github.com/cooderl/wewe-rss.git . |
|
|
|
|
|
FROM base AS build |
|
COPY --from=clone /usr/src/app /usr/src/app |
|
WORKDIR /usr/src/app |
|
|
|
|
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile |
|
RUN pnpm run -r build |
|
|
|
|
|
RUN pnpm deploy --filter=server --prod /app |
|
RUN pnpm deploy --filter=server --prod /app-sqlite |
|
|
|
|
|
RUN cd /app && pnpm exec prisma generate |
|
RUN cd /app-sqlite && rm -rf ./prisma && mv prisma-sqlite prisma && pnpm exec prisma generate |
|
|
|
|
|
WORKDIR /app |
|
EXPOSE 4000 |
|
|
|
ENV NODE_ENV=production |
|
ENV HOST="0.0.0.0" |
|
ENV SERVER_ORIGIN_URL="" |
|
ENV MAX_REQUEST_PER_MINUTE=60 |
|
ENV AUTH_CODE="" |
|
ENV DATABASE_URL="" |
|
ENV CRON_EXPRESSION="" |
|
RUN chmod +x ./docker-bootstrap.sh |
|
CMD ["./docker-bootstrap.sh"] |
|
|
|
|
|
FROM base AS app |
|
COPY --from=build /app /app |
|
WORKDIR /app |
|
EXPOSE 4000 |
|
|
|
ENV NODE_ENV=production |
|
ENV HOST="0.0.0.0" |
|
ENV SERVER_ORIGIN_URL="" |
|
ENV MAX_REQUEST_PER_MINUTE=60 |
|
ENV AUTH_CODE="" |
|
ENV DATABASE_URL="" |
|
ENV CRON_EXPRESSION="0 8 * * *" |
|
RUN chmod +x ./docker-bootstrap.sh |
|
CMD ["./docker-bootstrap.sh"] |
|
|