File tree Expand file tree Collapse file tree 1 file changed +21
-15
lines changed
Expand file tree Collapse file tree 1 file changed +21
-15
lines changed Original file line number Diff line number Diff line change 1- FROM node:18-alpine
1+ # Stage 1: Building the code
2+ FROM node:20 as builder
23
3- COPY . /app
4-
5- # Set the working directory
64WORKDIR /app
75
8- # Install pnpm
9- RUN npm install -g pnpm
6+ # Copy package.json and package-lock.json (if available)
7+ COPY package*.json ./
8+ COPY pnpm*.yaml ./
9+
10+ # Install pre-install deps
11+ RUN npm install --global pnpm
12+ RUN pnpm install
13+
14+ # Copy the code
15+ COPY . /app
1016
11- # By default, use the enterprise theme
12- ARG THEME=enterprise
17+ # Set our env vars needed for building it for /blog
18+ ENV NEXT_PUBLIC_BASE_URL='/blog'
19+ ENV NEXT_PUBLIC_MODE='production'
1320
14- WORKDIR /app/packages/blog-starter-kit/themes/${THEME}
15- RUN cp .env.example .env.local
16- RUN pnpm install --frozen-lockfile
21+ RUN cd packages/blog-starter-kit/themes/enterprise && \
22+ pnpm install
1723
18- RUN pnpm build
24+ RUN cd packages/blog-starter-kit/themes/enterprise && \
25+ pnpm run build
1926
20- # Expose the port Next.js runs on
2127EXPOSE 3000
2228
23- # Run the Next.js start script
24- CMD [ " pnpm" , "start" ]
29+ ENTRYPOINT [ "/bin/sh" , "-c" , "cd /app/packages/blog-starter-kit/themes/enterprise && /usr/local/bin/pnpm run start" ]
30+ # # RUN pnpm dev
You can’t perform that action at this time.
0 commit comments