Co-authored-by: openhands <openhands@all-hands.dev> Reviewed-on: https://codeberg.org/johba/harb/pulls/84
57 lines
1.5 KiB
Text
57 lines
1.5 KiB
Text
# Production image for Landing page (Vite + Vue)
|
|
# Used in CI for E2E testing - contains all code baked in
|
|
|
|
FROM node:20-alpine AS builder
|
|
|
|
RUN apk add --no-cache git bash
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files first for better caching
|
|
COPY package.json package-lock.json ./
|
|
COPY kraiken-lib/package.json kraiken-lib/package-lock.json ./kraiken-lib/
|
|
COPY landing/package.json landing/package-lock.json ./landing/
|
|
|
|
# Copy ABI files needed by kraiken-lib
|
|
COPY onchain/out/Kraiken.sol/Kraiken.json ./onchain/out/Kraiken.sol/
|
|
COPY onchain/out/Stake.sol/Stake.json ./onchain/out/Stake.sol/
|
|
|
|
# Install kraiken-lib dependencies and build
|
|
WORKDIR /app/kraiken-lib
|
|
RUN npm ci --ignore-scripts
|
|
COPY kraiken-lib/ ./
|
|
RUN ./node_modules/.bin/tsc
|
|
|
|
# Install landing dependencies
|
|
WORKDIR /app/landing
|
|
RUN npm ci
|
|
|
|
# Copy landing source
|
|
COPY landing/ ./
|
|
|
|
# Production image
|
|
FROM node:20-alpine
|
|
|
|
RUN apk add --no-cache dumb-init wget bash
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy kraiken-lib (src for vite alias, dist for runtime)
|
|
COPY --from=builder /app/kraiken-lib/src ./kraiken-lib/src
|
|
COPY --from=builder /app/kraiken-lib/dist ./kraiken-lib/dist
|
|
COPY --from=builder /app/kraiken-lib/package.json ./kraiken-lib/
|
|
COPY --from=builder /app/landing ./landing
|
|
|
|
WORKDIR /app/landing
|
|
|
|
ENV NODE_ENV=development
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=5174
|
|
|
|
EXPOSE 5174
|
|
|
|
HEALTHCHECK --interval=5s --timeout=3s --retries=6 --start-period=10s \
|
|
CMD wget --spider -q http://127.0.0.1:5174/ || exit 1
|
|
|
|
# Landing doesn't need contract addresses - just serve static content
|
|
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0", "--port", "5174"]
|