github-copilot-resources / copilot-metrics-viewer

Tool to visualize the Copilot metrics provided via the Copilot Business Metrics API (current in public beta)
https://ashy-sky-02a7d0403.5.azurestaticapps.net/
MIT License
215 stars 99 forks source link

consider building and hosting docker image #27

Closed AdrianDsg closed 1 month ago

AdrianDsg commented 1 month ago

Hi, I just discovered this great project.

Please consider building and hosting the docker image using GitHub Actions and the GitHub Container Registery (GHCR).

It would ease the usage of the project significantly.

AdrianDsg commented 1 month ago

As the current Dockerfile contains several vulnerabilities caused e.g. by using outdated images it might also be good adapting the file to fix those issues. This would also reduce the image and attack surface and therefore introduce several benefits:

# Stage 1: Build the Vue.js application
FROM node:21-alpine AS build-stage
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# Stage 2: Serve the application with Nginx
FROM nginxinc/nginx-unprivileged:1.26-alpine-slim AS production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

tl;dr replace outdated Node.js version and switch from Debian to Alpine Linux based images to reduce image size and attack surface.