Skip to content

Commit

Permalink
Merge pull request #16 from AElfProject/ci/sonarqube
Browse files Browse the repository at this point in the history
ci: sonarqube
  • Loading branch information
yongenaelf authored Jul 26, 2024
2 parents a3d6148 + 709b56a commit a937d7f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 51 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
on:
pull_request:
types: [opened, synchronize, reopened]

name: SonarQube
jobs:
sonarqube:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Disabling shallow clones is recommended for improving the relevancy of reporting
fetch-depth: 0
- name: SonarQube Scan
uses: sonarsource/[email protected] # Ex: v2.1.0, See the latest version at https://github.com/marketplace/actions/official-sonarqube-scan
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
with:
args: >
-Dsonar.projectKey=aelf-playground-next
25 changes: 7 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,33 +1,22 @@
FROM node:20-alpine AS base
FROM cgr.dev/chainguard/node

# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app

ENV NODE_ENV production

# Uncomment the following line in case you want to disable telemetry during runtime.
# ENV NEXT_TELEMETRY_DISABLED 1

RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs

COPY ./public ./public

# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next

# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --chown=nextjs:nodejs ./.next/standalone ./
COPY --chown=nextjs:nodejs ./.next/static ./.next/static

USER nextjs
COPY ./.next/standalone ./
COPY ./.next/static ./.next/static

EXPOSE 3000
ENV HOSTNAME=0.0.0.0

ENV PORT 3000
USER node

# server.js is created by next build from the standalone output
# https://nextjs.org/docs/pages/api-reference/next-config-js/output
CMD HOSTNAME="0.0.0.0" node server.js
CMD [ "server.js" ]
12 changes: 0 additions & 12 deletions Dockerfile.development

This file was deleted.

21 changes: 0 additions & 21 deletions compose.yml

This file was deleted.

0 comments on commit a937d7f

Please sign in to comment.