-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #379 from leovct/fix/zkevm-bridge-img-revert
revert: zkevm-bridge-ui image changes
- Loading branch information
Showing
3 changed files
with
16 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,13 @@ | ||
diff --git a/scripts/deploy.sh b/scripts/deploy.sh | ||
index 22e5b09..b751cbd 100644 | ||
index 22e5b09..00da634 100644 | ||
--- a/scripts/deploy.sh | ||
+++ b/scripts/deploy.sh | ||
@@ -21,6 +21,9 @@ echo "VITE_POLYGON_ZK_EVM_NETWORK_ID=$POLYGON_ZK_EVM_NETWORK_ID" >> $ENV_FILENAM | ||
# BRIDGE API env vars | ||
echo "VITE_BRIDGE_API_URL=$BRIDGE_API_URL" >> $ENV_FILENAME | ||
|
||
+# Support for relative URLS | ||
+echo "VITE_RESOLVE_RELATIVE_URLS=$RESOLVE_RELATIVE_URLS" >> $ENV_FILENAME | ||
+ | ||
# FIAT EXCHANGE RATES API env vars | ||
echo "VITE_ENABLE_FIAT_EXCHANGE_RATES=$ENABLE_FIAT_EXCHANGE_RATES" >> $ENV_FILENAME | ||
|
||
@@ -91,17 +94,5 @@ fi | ||
echo "Generated .env file:" | ||
echo "$(cat /app/.env)" | ||
|
||
-# Build app | ||
-cd /app && npm run build | ||
- | ||
-# Copy nginx config | ||
-cp /app/deployment/nginx.conf /etc/nginx/conf.d/default.conf | ||
- | ||
-# Copy app dist | ||
-cp -r /app/dist/. /usr/share/nginx/html | ||
- | ||
-# Delete source code | ||
-rm -rf /app | ||
- | ||
# Run nginx | ||
nginx -g 'daemon off;' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,35 @@ | ||
FROM alpine:3.20 AS builder | ||
|
||
# STEP 1: Clone zkevm-bridge-ui repository. | ||
ARG ZKEVM_BRIDGE_UI_TAG | ||
WORKDIR /opt/zkevm-bridge-ui | ||
# WARNING (DL3018): Pin versions in apk add. | ||
# hadolint ignore=DL3018 | ||
RUN apk add --no-cache git nodejs npm patch \ | ||
RUN apk add --no-cache git patch \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& git clone --branch ${ZKEVM_BRIDGE_UI_TAG} https://github.com/0xPolygonHermez/zkevm-bridge-ui . | ||
|
||
# STEP 2: Apply patches and build the app. | ||
# STEP 2: Apply patches. | ||
COPY deploy.sh.diff env.ts.diff ./ | ||
RUN patch -p1 -i deploy.sh.diff \ | ||
&& patch -p1 -i env.ts.diff \ | ||
&& npm install \ | ||
&& npm run build | ||
&& patch -p1 -i env.ts.diff | ||
|
||
|
||
# STEP 3: Serve the app using nginx. | ||
# STEP 3: Build zkevm-bridge-ui image using the official Dockerfile. | ||
FROM nginx:alpine | ||
LABEL author="[email protected]" | ||
LABEL description="Enhanced zkevm-bridge-ui image with relative URLs support enabled" | ||
|
||
COPY --from=builder /opt/zkevm-bridge-ui/dist /usr/share/nginx/html | ||
COPY --from=builder /opt/zkevm-bridge-ui/deployment/nginx.conf /etc/nginx/conf.d/default.conf | ||
# WARNING (DL3018): Pin versions in apk add. | ||
# hadolint ignore=DL3018 | ||
RUN apk add --no-cache nodejs npm \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
WORKDIR /app | ||
COPY --from=builder /opt/zkevm-bridge-ui/package.json /opt/zkevm-bridge-ui/package-lock.json ./ | ||
COPY --from=builder /opt/zkevm-bridge-ui/scripts ./scripts | ||
COPY --from=builder /opt/zkevm-bridge-ui/abis ./abis | ||
RUN npm install | ||
COPY --from=builder /opt/zkevm-bridge-ui/ . | ||
|
||
WORKDIR / | ||
ENTRYPOINT ["/bin/sh", "/app/scripts/deploy.sh"] |