diff --git a/.fleet/frontend-deployment.yaml b/.fleet/frontend-deployment.yaml deleted file mode 100644 index f3f1121..0000000 --- a/.fleet/frontend-deployment.yaml +++ /dev/null @@ -1,21 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: frontend -spec: - selector: - matchLabels: - app: codex - tier: frontend - replicas: 1 - template: - metadata: - labels: - app: codex - tier: frontend - spec: - containers: - - name: app - image: ghcr.io/aulasoftwarelibre/codex:v1.0 - ports: - - containerPort: 3000 diff --git a/.fleet/frontend-service.yaml b/.fleet/frontend-service.yaml deleted file mode 100644 index 520ee2f..0000000 --- a/.fleet/frontend-service.yaml +++ /dev/null @@ -1,14 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: frontend - labels: - app: codex - tier: frontend -spec: - type: NodePort - ports: - - port: 3000 - selector: - app: codex - tier: frontend diff --git a/Dockerfile b/Dockerfile index 70067d9..7cc3732 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ FROM node:20-alpine AS base - RUN corepack enable + RUN corepack enable pnpm # Install dependencies only when needed FROM base AS deps @@ -10,9 +10,9 @@ FROM base AS deps # Install dependencies based on the preferred package manager COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc ./ RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ + if [ -f yarn.lock ]; then yarn install --frozen-lockfile; \ elif [ -f package-lock.json ]; then npm ci; \ - elif [ -f pnpm-lock.yaml ]; then pnpm i --frozen-lockfile; \ + elif [ -f pnpm-lock.yaml ]; then pnpm install --frozen-lockfile; \ else echo "Lockfile not found." && exit 1; \ fi @@ -26,7 +26,7 @@ FROM base AS builder # Next.js collects completely anonymous telemetry data about general usage. # Learn more here: https://nextjs.org/telemetry # Uncomment the following line in case you want to disable telemetry during the build. - ENV NEXT_TELEMETRY_DISABLED 1 + ENV NEXT_TELEMETRY_DISABLED=1 RUN pnpm run build @@ -37,9 +37,9 @@ FROM base AS builder FROM base AS runner WORKDIR /app - ENV NODE_ENV production + ENV NODE_ENV=production # Uncomment the following line in case you want to disable telemetry during runtime. - ENV NEXT_TELEMETRY_DISABLED 1 + ENV NEXT_TELEMETRY_DISABLED=1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs @@ -61,8 +61,8 @@ FROM base AS runner EXPOSE 3000 - ENV PORT 3000 + ENV PORT=3000 # set hostname to localhost - ENV HOSTNAME "0.0.0.0" + ENV HOSTNAME="0.0.0.0" - CMD pnpm dlx prisma migrate deploy && node server.js + CMD ["/bin/sh", "-c", "pnpm dlx prisma migrate deploy && node server.js"] diff --git a/package.json b/package.json index d3a51ea..82ea2c4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,6 @@ "start": "next start", "lint": "next lint", "prepare": "husky", - "postinstall": "pnpm dlx prisma generate", "test": "vitest", "coverage": "vitest run --coverage", "test:ci": "NODE_ENV=test vitest --watch=false", diff --git a/src/app/(auth)/actions/sign-out-action.ts b/src/app/(auth)/actions/sign-out-action.ts index 43afa69..7fd63de 100644 --- a/src/app/(auth)/actions/sign-out-action.ts +++ b/src/app/(auth)/actions/sign-out-action.ts @@ -2,13 +2,13 @@ import { signOut } from '@/lib/auth/auth' -export async function signOutAction() { +export async function signOutAction(): Promise { try { return signOut({ redirectTo: '/' }) } catch (error) { console.error(`ERROR IN SIGN OUT: ${(error as Error).toString()}`) if ((error as Error).message) { - return (error as Error).message + return } throw error diff --git a/src/app/(auth)/components/sign-in-email-form.tsx b/src/app/(auth)/components/sign-in-email-form.tsx index 409b7f0..47150ad 100644 --- a/src/app/(auth)/components/sign-in-email-form.tsx +++ b/src/app/(auth)/components/sign-in-email-form.tsx @@ -38,7 +38,7 @@ export function SignInEmailForm() { variant="bordered" />