dashboard-nanobot/frontend/Dockerfile

31 lines
656 B
Docker
Raw Normal View History

2026-03-01 16:26:03 +00:00
ARG NODE_BASE_IMAGE=node:20-alpine
2026-03-01 17:26:54 +00:00
ARG NGINX_BASE_IMAGE=nginx:alpine
2026-03-01 16:26:03 +00:00
FROM ${NODE_BASE_IMAGE} AS build
WORKDIR /app
ARG NPM_REGISTRY=https://registry.npmjs.org/
2026-03-01 17:33:23 +00:00
COPY package.json yarn.lock ./
RUN corepack enable \
&& yarn config set registry "${NPM_REGISTRY}" \
&& yarn install --frozen-lockfile --network-timeout 120000
2026-03-01 16:26:03 +00:00
COPY . .
ARG VITE_API_BASE=/api
ARG VITE_WS_BASE=/ws/monitor
ENV VITE_API_BASE=${VITE_API_BASE}
ENV VITE_WS_BASE=${VITE_WS_BASE}
2026-03-01 17:33:23 +00:00
RUN yarn build
2026-03-01 16:26:03 +00:00
FROM ${NGINX_BASE_IMAGE}
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]