Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move to nuxt3 #144

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .browserslistrc

This file was deleted.

5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,8 @@ infra/
/test-results-docker/
test-results-docker-ent/
test-results-docker-org/

.nuxt/
.output/
.vscode/
dist/
23 changes: 12 additions & 11 deletions .env
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# Determines if mocked data should be used instead of making API calls.
VUE_APP_MOCKED_DATA=true
NUXT_PUBLIC_IS_DATA_MOCKED=true

# Determines the scope of the API calls.
# Can be 'enterprise' or 'organization' to target API calls to an enterprise or an organization respectively.
VUE_APP_SCOPE=organization
NUXT_PUBLIC_SCOPE=organization

# Determines the enterprise or organization name to target API calls.
VUE_APP_GITHUB_ORG=octodemo
NUXT_PUBLIC_GITHUB_ORG=cody-test-org

VUE_APP_GITHUB_ENT=
NUXT_PUBLIC_GITHUB_ENT=

# Determines the team name if exists to target API calls.
VUE_APP_GITHUB_TEAM=
NUXT_PUBLIC_GITHUB_TEAM=

NUXT_PUBLIC_USING_GITHUB_AUTH=false

# Determines the GitHub Personal Access Token to use for API calls.
# Create with scopes copilot, manage_billing:copilot or manage_billing:enterprise, read:enterprise AND read:org
VUE_APP_GITHUB_TOKEN=
# NUXT_GITHUB_TOKEN=<TOKEN>

# GitHub Api Url
# for proxy api - set to /api/github defaults to https://api.github.com
VUE_APP_GITHUB_API=
NUXT_SESSION_PASSWORD=something_long_and_random_thats_at_least_32_characters

# Random string used in API to secure session, use when VUE_APP_GITHUB_API=/api/github
#SESSION_SECRET=randomstring
# for Github OAuth
NUXT_OAUTH_GITHUB_CLIENT_ID=
NUXT_OAUTH_GITHUB_CLIENT_SECRET=
19 changes: 0 additions & 19 deletions .eslintrc.js

This file was deleted.

53 changes: 23 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
.DS_Store
node_modules
/dist

# Nuxt dev/build outputs
.output
.data
.nuxt
.nitro
.cache
dist

# local env files
.env.local
.env.*.local
# Node dependencies
node_modules

# Log files
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# Logs
logs
*.log

# Editor directories and files
# Misc
.DS_Store
.fleet
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
.azure

api/public
test.http

/playwright-report/
/blob-report/
/playwright/.cache/
# Local env files
.env
.env.*
!.env.example

/test-results/
/test-results-docker/
test-results-docker-ent/
test-results-docker-org/
# Playwright
playwright-report
playwright-logs
test-results
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run nuxt",
"runtimeExecutable": "nuxt",
"cwd": "${workspaceFolder}",
"args": []
},
{
"type": "node-terminal",
"name": "Run Script: dev",
"request": "launch",
"command": "npm run dev",
"cwd": "${workspaceFolder}"
}
]
}
60 changes: 49 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,55 @@
# Stage 1: Build the Vue.js application
# mode can be 'prod' - default or 'playwright'
# for 'playwright' mode, the final image will be base-playwright
# for 'prod' mode, the final image will be base-prod
# build with 'docker build -t copilot-metrics-pw --build-arg mode=playwright .'
# build with 'docker build -t copilot-metrics .' for production
ARG mode=prod

FROM node:23-alpine AS build-stage

USER node
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .

COPY --chown=1000:1000 package*.json ./
RUN npm ci
COPY --chown=1000:1000 . .
RUN npm run build

# Stage 2: Serve the application with Nginx
FROM nginx:1.27 AS production-stage
# Stage 2: Prepare the Node.js API
FROM node:23-alpine AS base-prod

WORKDIR /app
COPY --chown=1000:1000 --from=build-stage /app/.output /app

# Expose the port your API will run on
EXPOSE 3000

USER node
CMD ["node", "/app/server/index.mjs"]

#-----------------------------------
FROM mcr.microsoft.com/playwright:v1.49.1 AS base-playwright

WORKDIR /pw

RUN apt-get update && \
apt-get install -y --no-install-recommends gettext-base && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY --chown=1000:1000 --from=base-prod /app /app
COPY --chown=1000:1000 e2e-tests ./e2e-tests
COPY --chown=1000:1000 playwright.config.ts playwright.docker.config.ts tsconfig.json package*.json ./

RUN npm install --only=dev

# RUN npx playwright install --with-deps
# this isn't a secret - it's only used in Playwright tests
ENV NUXT_SESSION_PASSWORD=foo-foo-foo-foo-foo-foo-foo-foo-foo-foo-foo-foo
# ENV CI=true

ENTRYPOINT [ "npx", "playwright", "test", "-c", "playwright.docker.config.ts" ]

COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY --from=build-stage /app/dist/assets/app-config.js /usr/share/nginx/html-template/app-config.template.js
COPY ./docker-entrypoint.d/*.sh /docker-entrypoint.d/
RUN chmod +x /docker-entrypoint.d/*.sh
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
#-----------------------------------
FROM base-${mode} AS final
72 changes: 0 additions & 72 deletions api.Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions api/.env

This file was deleted.

16 changes: 0 additions & 16 deletions api/docker-entrypoint.api/entrypoint.sh

This file was deleted.

Loading
Loading