dashboard-nanobot/frontend/Dockerfile

35 lines
872 B
Docker
Raw Permalink Normal View History

2026-03-01 17:39:59 +00:00
ARG NODE_BASE_IMAGE=node:22-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 ./
2026-03-01 17:39:59 +00:00
RUN npm config set registry "${NPM_REGISTRY}" \
2026-03-01 17:46:12 +00:00
&& rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg \
2026-03-01 17:39:59 +00:00
&& npm install -g yarn@1.22.22 --registry "${NPM_REGISTRY}" \
2026-03-01 17:33:23 +00:00
&& 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}
2026-03-13 06:40:54 +00:00
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf.template
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
2026-03-01 16:26:03 +00:00
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
2026-03-13 06:40:54 +00:00
CMD ["/entrypoint.sh"]