Skip to content

Commit 8e7704c

Browse files
committed
Revert "🐛 Bugfix: Build frontend arm image failed"
This reverts commit c120147.
1 parent c120147 commit 8e7704c

File tree

1 file changed

+7
-35
lines changed

1 file changed

+7
-35
lines changed

make/web/Dockerfile

Lines changed: 7 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,10 @@ COPY frontend /opt/frontend
77

88
# Build Next.js application
99
WORKDIR /opt/frontend
10-
# Configure npm with increased timeout and retry settings
1110
RUN if [ -n "$MIRROR" ]; then npm config set registry "$MIRROR"; fi && \
12-
npm config set fetch-timeout 600000 && \
13-
npm config set fetch-retries 5 && \
14-
npm config set fetch-retry-mintimeout 20000 && \
15-
npm config set fetch-retry-maxtimeout 120000
16-
17-
# Install dependencies with retry mechanism
18-
RUN npm install --verbose || \
19-
(echo "First install attempt failed, retrying..." && sleep 5 && npm install --verbose) || \
20-
(echo "Second install attempt failed, retrying..." && sleep 10 && npm install --verbose)
21-
22-
# Build Next.js with increased timeout and memory
23-
# Set environment variables for Next.js build
24-
# Add retry mechanism for network timeouts during build (e.g., Google Fonts loading)
25-
RUN NODE_ENV=production \
26-
NODE_OPTIONS="--max-old-space-size=4096" \
27-
NEXT_TELEMETRY_DISABLED=1 \
28-
(npm run build || \
29-
(echo "Build failed, retrying after 10 seconds..." && sleep 10 && npm run build) || \
30-
(echo "Second build attempt failed, retrying after 20 seconds..." && sleep 20 && npm run build))
31-
32-
# Prepare production distribution
33-
RUN mkdir -p ../frontend-dist && \
11+
npm install --verbose && \
12+
NODE_ENV=production npm run build && \
13+
mkdir -p ../frontend-dist && \
3414
cp -r .next ../frontend-dist/ && \
3515
cp -r public ../frontend-dist/ && \
3616
cp server.js ../frontend-dist/server.js && \
@@ -48,18 +28,10 @@ RUN mkdir -p ../frontend-dist && \
4828
"http-proxy": "^1.18.1",\
4929
"dotenv": "^16.4.7"\
5030
}\
51-
}' > ../frontend-dist/package.json
52-
53-
# Install production dependencies with retry mechanism
54-
WORKDIR /opt/frontend-dist
55-
RUN if [ -n "$MIRROR" ]; then npm config set registry "$MIRROR"; fi && \
56-
npm config set fetch-timeout 600000 && \
57-
npm config set fetch-retries 5 && \
58-
npm config set fetch-retry-mintimeout 20000 && \
59-
npm config set fetch-retry-maxtimeout 120000 && \
60-
(npm install --verbose --omit=dev --production || \
61-
(echo "First install attempt failed, retrying..." && sleep 5 && npm install --verbose --omit=dev --production) || \
62-
(echo "Second install attempt failed, retrying..." && sleep 10 && npm install --verbose --omit=dev --production)) && \
31+
}' > ../frontend-dist/package.json && \
32+
cd ../frontend-dist && \
33+
if [ -n "$MIRROR" ]; then npm config set registry "$MIRROR"; fi && \
34+
npm install --verbose --omit=dev --production && \
6335
npm cache clean --force && \
6436
rm -rf /root/.npm && \
6537
rm -rf /root/.cache && \

0 commit comments

Comments
 (0)