Skip to content

Commit

Permalink
Fix Gateway frontend dockerfile (#2122)
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj authored Nov 5, 2024
1 parent 8c3b172 commit fafdc46
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-ten-gateway-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
- name: "Build and Push Docker Image"
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg NEXT_PUBLIC_API_HOST_ENVIRONMENT="${{ github.event.inputs.testnet_type }}"" \
--build-arg NEXT_PUBLIC_API_HOST_ENVIRONMENT="${{ github.event.inputs.testnet_type }}" \
--build-arg NEXT_PUBLIC_NETWORK_NAME="${{ env.NETWORK_NAME }}" \
--build-arg NEXT_PUBLIC_TENSCAN_URL="${{ env.TENSCAN_URL }}" \
--build-arg NEXT_PUBLIC_GATEWAY_URL="${{ env.GATEWAY_URL }}" \
Expand Down
11 changes: 7 additions & 4 deletions tools/walletextension/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Use an official Node.js LTS version as a base image
FROM node:20-alpine AS base

# Install pnpm
RUN npm install -g pnpm


ARG NEXT_PUBLIC_NETWORK_NAME
ARG NEXT_PUBLIC_TENSCAN_URL
ARG NEXT_PUBLIC_GATEWAY_URL
Expand All @@ -21,25 +21,28 @@ WORKDIR /usr/src/app
COPY tools/walletextension/frontend/ .

# Install dependencies
RUN pnpm ci
RUN pnpm install --frozen-lockfile

# Build the Next.js app
RUN pnpm run build

# Reduce the size of the final image by using a lighter base image
FROM node:20-alpine AS runner

# Install pnpm
RUN npm install -g pnpm

# Set the working directory
WORKDIR /usr/src/app

# Copy only the necessary files from the build stage
COPY --from=base /usr/src/app/.next ./.next
COPY --from=base /usr/src/app/public ./public
COPY --from=base /usr/src/app/package*.json ./
COPY --from=base /usr/src/app/pnpm-lock.yaml ./

# Install production dependencies
RUN pnpm ci --production

RUN pnpm install --prod --frozen-lockfile

# Set the environment variables
ENV PORT=80
Expand Down

0 comments on commit fafdc46

Please sign in to comment.