forked from cooderl/wewe-rss
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
53 lines (32 loc) · 934 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM node:20-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN npm i -g pnpm
FROM base AS build
COPY . /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=web --prod /app/web
RUN pnpm deploy --filter=server --prod /app/server
RUN cd /app/server && pnpm exec prisma generate
FROM base AS web
COPY --from=build /app/web /app/web
WORKDIR /app/web
EXPOSE 3000
ENV NODE_ENV=production
ENV NEXT_PUBLIC_SERVER_ORIGIN_URL="http://localhost:4000"
ENV NEXT_PUBLIC_ENV=prod
CMD ["npm", "run", "start"]
FROM base AS server
COPY --from=build /app/server /app/server
WORKDIR /app/server
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=""
RUN chmod +x ./docker-bootstrap.sh
CMD ["./docker-bootstrap.sh"]