frontendt / Dockerfile
ayushsinghal1510's picture
Fixed
b6e6ebf
Raw
History Blame Contribute Delete
1.12 kB
# ── Build stage ──────────────────────────────────────────────────────────────
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
# These are injected at build time so Vite can embed them in the JS bundle.
# Set them as Build secrets in your HF Space (Settings β†’ Repository secrets).
ARG VITE_WEBHOOK_URL
ARG VITE_FLOW_API_KEY
ARG VITE_VX_SERVER=voice.voxio.in
ENV VITE_WEBHOOK_URL=${VITE_WEBHOOK_URL} \
VITE_FLOW_API_KEY=${VITE_FLOW_API_KEY} \
VITE_VX_SERVER=${VITE_VX_SERVER}
RUN npm run build
# ── Runtime stage ─────────────────────────────────────────────────────────────
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --omit=dev
COPY server.js ./
COPY assets ./assets
COPY --from=build /app/dist ./dist
# HF Spaces exposes port 7860
ENV PORT=7860
EXPOSE 7860
CMD ["node", "server.js"]