mirror of
https://github.com/skidoodle/erettsegi-browser.git
synced 2026-04-28 05:27:35 +02:00
feat: update Next.js configuration and dependencies, add Docker support
- Set output mode to "standalone" in next.config.ts - Update dependencies in package.json: - Upgrade @heroui/react to ^2.8.5 - Upgrade framer-motion to ^12.23.25 - Upgrade next to 16.0.7 - Upgrade react and react-dom to 19.2.1 - Upgrade undici to ^7.16.0 - Upgrade devDependencies including @biomejs/biome, @tailwindcss/postcss, and typescript - Modify error handling in API routes to simplify catch blocks - Refactor NotFound component for cleaner JSX structure - Update global CSS imports for consistency - Change tsconfig to use "react-jsx" for JSX and include additional type definitions - Add GitHub Actions workflow for Docker image build and push - Create Dockerfile for multi-stage build process - Add development and production Docker Compose configurations ai commit message xd
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
name: Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "main" ]
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
id-token: write
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install cosign
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: sigstore/cosign-installer@v3.5.0
|
||||
with:
|
||||
cosign-release: 'v2.1.1'
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: Log into registry ${{ env.REGISTRY }}
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ${{ env.REGISTRY }}
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
id: build-and-push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
platforms: linux/amd64,linux/arm64
|
||||
|
||||
- name: Sign the published Docker image
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
DIGEST: ${{ steps.build-and-push.outputs.digest }}
|
||||
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
FROM oven/bun:1 AS base
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS deps
|
||||
COPY package.json bun.lock* ./
|
||||
RUN bun install --no-save --frozen-lockfile
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN bun run build
|
||||
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV NODE_ENV=production \
|
||||
PORT=3000 \
|
||||
HOSTNAME="0.0.0.0"
|
||||
RUN addgroup --system --gid 1001 nodejs && \
|
||||
adduser --system --uid 1001 nextjs
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
USER nextjs
|
||||
EXPOSE 3000
|
||||
CMD ["bun", "./server.js"]
|
||||
+11
-3
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
|
||||
"$schema": "https://biomejs.dev/schemas/2.3.8/schema.json",
|
||||
"vcs": {
|
||||
"enabled": true,
|
||||
"clientKind": "git",
|
||||
@@ -10,8 +10,7 @@
|
||||
},
|
||||
"formatter": {
|
||||
"enabled": true,
|
||||
"indentStyle": "tab",
|
||||
"lineWidth": 80
|
||||
"indentStyle": "tab"
|
||||
},
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
@@ -20,8 +19,17 @@
|
||||
}
|
||||
},
|
||||
"javascript": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double",
|
||||
"jsxQuoteStyle": "double"
|
||||
}
|
||||
},
|
||||
"css": {
|
||||
"formatter": {
|
||||
"quoteStyle": "double"
|
||||
},
|
||||
"parser": {
|
||||
"tailwindDirectives": true
|
||||
}
|
||||
},
|
||||
"assist": {
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
services:
|
||||
erettsegi-browser:
|
||||
build: .
|
||||
container_name: erettsegi-browser
|
||||
ports:
|
||||
- "3000:3000"
|
||||
@@ -0,0 +1,7 @@
|
||||
services:
|
||||
erettsegi-browser:
|
||||
image: ghcr.io/skidoodle/erettsegi-browser:main
|
||||
container_name: erettsegi-browser
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
@@ -50,6 +50,7 @@ const nextConfig: NextConfig = {
|
||||
},
|
||||
reactStrictMode: true,
|
||||
poweredByHeader: false,
|
||||
output: "standalone",
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
|
||||
+16
-16
@@ -5,32 +5,32 @@
|
||||
"author": "albert|skidoodle@gh",
|
||||
"license": "AGPL-3.0",
|
||||
"scripts": {
|
||||
"dev": "next dev --turbopack",
|
||||
"dev": "next dev",
|
||||
"build": "next build",
|
||||
"start": "next start",
|
||||
"lint": "biome lint --write",
|
||||
"format": "biome format --write"
|
||||
},
|
||||
"dependencies": {
|
||||
"@heroui/react": "^2.8.0-beta.9",
|
||||
"framer-motion": "^12.18.1",
|
||||
"next": "15.4.8",
|
||||
"@heroui/react": "^2.8.5",
|
||||
"framer-motion": "^12.23.25",
|
||||
"next": "16.0.7",
|
||||
"next-themes": "^0.4.6",
|
||||
"react": "19.1.0",
|
||||
"react-dom": "19.1.0",
|
||||
"react": "19.2.1",
|
||||
"react-dom": "19.2.1",
|
||||
"react-icons": "^5.5.0",
|
||||
"undici": "^7.10.0"
|
||||
"undici": "^7.16.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@biomejs/biome": "2.0.0",
|
||||
"@tailwindcss/postcss": "^4.1.10",
|
||||
"@types/node": "24.0.3",
|
||||
"@types/react": "19.1.8",
|
||||
"@types/react-dom": "19.1.6",
|
||||
"@biomejs/biome": "2.3.8",
|
||||
"@tailwindcss/postcss": "^4.1.17",
|
||||
"@types/node": "24.10.1",
|
||||
"@types/react": "19.2.7",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"postcss": "8.5.6",
|
||||
"prettier": "^3.5.3",
|
||||
"prettier-plugin-tailwindcss": "^0.6.13",
|
||||
"tailwindcss": "^4.1.10",
|
||||
"typescript": "5.8.3"
|
||||
"prettier": "^3.7.4",
|
||||
"prettier-plugin-tailwindcss": "^0.7.2",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"typescript": "5.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ export async function GET(req: NextRequest) {
|
||||
let url: URL;
|
||||
try {
|
||||
url = new URL(link);
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
return NextResponse.json(
|
||||
{ error: "Érvénytelen link formátum" },
|
||||
{ status: 400 },
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function GET(req: NextRequest) {
|
||||
let url: URL;
|
||||
try {
|
||||
url = new URL(link);
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
return NextResponse.json(
|
||||
{ error: "Érvénytelen link formátum" },
|
||||
{ status: 400 },
|
||||
|
||||
@@ -6,7 +6,6 @@ import Link from "next/link";
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<>
|
||||
<main className="dark:bg-[#121212] text-foreground bg-background py-5">
|
||||
<div className="flex min-h-screen flex-col items-center justify-center">
|
||||
<h1 className="text-7xl font-bold text-blue-400">404</h1>
|
||||
@@ -21,6 +20,5 @@ export default function NotFound() {
|
||||
</div>
|
||||
<Footer />
|
||||
</main>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ const ResourceComponent = ({ label, link }: ResourceProps) => {
|
||||
const response = await fetch(`/api/validate?link=${encodeURI(link)}`);
|
||||
const data = (await response.json()) as { status: number };
|
||||
setStatus(data.status);
|
||||
} catch (_error) {
|
||||
} catch {
|
||||
setStatus(500);
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
@import "tailwindcss";
|
||||
@plugin './hero.ts';
|
||||
@plugin "./hero.ts";
|
||||
|
||||
@source '../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}';
|
||||
@source "../../node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}";
|
||||
@custom-variant dark (&:is(.dark *));
|
||||
|
||||
@layer base {
|
||||
|
||||
+8
-6
@@ -5,39 +5,41 @@
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"jsx": "preserve",
|
||||
"jsx": "react-jsx",
|
||||
"incremental": true,
|
||||
"plugins": [
|
||||
{
|
||||
"name": "next"
|
||||
}
|
||||
],
|
||||
|
||||
/* Strictness */
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
|
||||
/* Module Resolution */
|
||||
"module": "esnext",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"verbatimModuleSyntax": true,
|
||||
|
||||
/* Code Style */
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
/* Path Aliases */
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
|
||||
"include": [
|
||||
"next-env.d.ts",
|
||||
"**/*.ts",
|
||||
"**/*.tsx",
|
||||
".next/types/**/*.ts",
|
||||
".next/dev/types/**/*.ts"
|
||||
],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user