File tree 1 file changed +21
-15
lines changed 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
2
3
3
- COPY . /app
4
-
5
- # Set the working directory
6
4
WORKDIR /app
7
5
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
10
16
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'
13
20
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
17
23
18
- RUN pnpm build
24
+ RUN cd packages/blog-starter-kit/themes/enterprise && \
25
+ pnpm run build
19
26
20
- # Expose the port Next.js runs on
21
27
EXPOSE 3000
22
28
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