Skip to content

Commit

Permalink
upd Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kvs96 committed Dec 26, 2024
1 parent 372a873 commit a9d5431
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions digit-recognition/frontend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
FROM node:18-alpine

MAINTAINER gear
FROM node:18-alpine AS builder

WORKDIR /opt

COPY . .
RUN apk add --no-cache xsel

RUN apk update
COPY package.json yarn.lock ./

RUN apk add xsel
RUN yarn install --frozen-lockfile

COPY . .

ARG VITE_WALLET_CONNECT_PROJECT_ID
ARG VITE_GEAR_API_NODE
ARG VITE_ETH_NODE_ADDRESS
ARG VITE_CONTRACT_ADDRESS

ARG VITE_WALLET_CONNECT_PROJECT_ID \
VITE_GEAR_API_NODE \
VITE_ETH_NODE_ADDRESS \
VITE_CONTRACT_ADDRESS
ENV VITE_WALLET_CONNECT_PROJECT_ID=${VITE_WALLET_CONNECT_PROJECT_ID} \
VITE_CONTRACT_ADDRESS=${VITE_CONTRACT_ADDRESS} \
VITE_GEAR_API_NODE=${VITE_GEAR_API_NODE} \
VITE_ETH_NODE_ADDRESS=${VITE_ETH_NODE_ADDRESS} \
DISABLE_ESLINT_PLUGIN=true

RUN yarn install
RUN yarn build && yarn cache clean

RUN yarn build

FROM node:18-alpine

WORKDIR /opt

RUN npm install --global serve

CMD ["serve", "-s", "/opt/dist"]
COPY --from=builder /opt/dist ./dist

ARG NODE_ENV
ENV NODE_ENV=${NODE_ENV}

EXPOSE 4173

CMD ["serve", "-s", "dist"]

0 comments on commit a9d5431

Please sign in to comment.