diff --git a/tools/walletextension/frontend/Dockerfile b/tools/walletextension/frontend/Dockerfile new file mode 100644 index 0000000000..2c906ee1a4 --- /dev/null +++ b/tools/walletextension/frontend/Dockerfile @@ -0,0 +1,18 @@ +# Use an official Node.js 22 as a parent image +FROM node:22-alpine + +WORKDIR /usr/src/app + +# ARG for build-time variable (GATEWAY_API_URL) +ARG GATEWAY_API_URL + +# ENV for URL to be used in the app +ENV NEXT_PUBLIC_API_GATEWAY_URL=${GATEWAY_API_URL} + +# Copy package.json and package-lock.json (or yarn.lock) into the container +COPY package*.json ./ + +RUN npm install +COPY . . +RUN npm run build +CMD ["npm", "start"] \ No newline at end of file diff --git a/tools/walletextension/frontend/next.config.js b/tools/walletextension/frontend/next.config.js index 04472f7ff7..50f8420725 100644 --- a/tools/walletextension/frontend/next.config.js +++ b/tools/walletextension/frontend/next.config.js @@ -1,14 +1,9 @@ /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, - output: "export", - // distDir should be "../api/static" in production but .next in development - distDir: process.env.NODE_ENV === "development" ? ".next" : "../api/static", images: { unoptimized: true, }, - // base path for static files should be "" in development but "/static" in production - basePath: process.env.NODE_ENV === "development" ? "" : "/static", }; module.exports = nextConfig;