forked from git.gladyson/openmonetis
Configuração para permitir uma porta diferente no pnpm e não a 3000
This commit is contained in:
@@ -1,4 +1,8 @@
|
|||||||
import type { NextConfig } from "next";
|
import type { NextConfig } from "next";
|
||||||
|
import dotenv from "dotenv";
|
||||||
|
|
||||||
|
// Carregar variáveis de ambiente explicitamente
|
||||||
|
dotenv.config();
|
||||||
|
|
||||||
const nextConfig: NextConfig = {
|
const nextConfig: NextConfig = {
|
||||||
// Output standalone para Docker (gera build otimizado com apenas deps necessárias)
|
// Output standalone para Docker (gera build otimizado com apenas deps necessárias)
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "tsx scripts/dev.ts",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
"db:generate": "drizzle-kit generate",
|
"db:generate": "drizzle-kit generate",
|
||||||
"db:migrate": "drizzle-kit migrate",
|
"db:migrate": "drizzle-kit migrate",
|
||||||
"db:push": "drizzle-kit push",
|
"db:push": "drizzle-kit push",
|
||||||
|
"db:enableExtensions": "tsx scripts/postgres/enable-extensions.ts",
|
||||||
"db:studio": "drizzle-kit studio",
|
"db:studio": "drizzle-kit studio",
|
||||||
"docker:up": "docker compose up --build",
|
"docker:up": "docker compose up --build",
|
||||||
"docker:up:db": "docker compose up -d db",
|
"docker:up:db": "docker compose up -d db",
|
||||||
@@ -79,9 +80,11 @@
|
|||||||
"@tailwindcss/postcss": "4.1.17",
|
"@tailwindcss/postcss": "4.1.17",
|
||||||
"@types/d3-array": "^3.2.2",
|
"@types/d3-array": "^3.2.2",
|
||||||
"@types/node": "24.10.1",
|
"@types/node": "24.10.1",
|
||||||
|
"@types/pg": "^8.15.6",
|
||||||
"@types/react": "19.2.7",
|
"@types/react": "19.2.7",
|
||||||
"@types/react-dom": "19.2.3",
|
"@types/react-dom": "19.2.3",
|
||||||
"depcheck": "^1.4.7",
|
"depcheck": "^1.4.7",
|
||||||
|
"dotenv": "^17.2.3",
|
||||||
"drizzle-kit": "0.31.7",
|
"drizzle-kit": "0.31.7",
|
||||||
"eslint": "9.39.1",
|
"eslint": "9.39.1",
|
||||||
"eslint-config-next": "16.0.4",
|
"eslint-config-next": "16.0.4",
|
||||||
|
|||||||
17
scripts/dev.ts
Normal file
17
scripts/dev.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env tsx
|
||||||
|
|
||||||
|
import { execSync } from 'child_process';
|
||||||
|
import { config } from 'dotenv';
|
||||||
|
|
||||||
|
// Carregar variáveis de ambiente
|
||||||
|
config();
|
||||||
|
|
||||||
|
const port = process.env.PORT || '3000';
|
||||||
|
|
||||||
|
console.log(`Starting Next.js development server on port ${port}...`);
|
||||||
|
|
||||||
|
// Executar next dev com a porta especificada
|
||||||
|
execSync(`npx next dev --turbopack --port ${port}`, {
|
||||||
|
stdio: 'inherit',
|
||||||
|
env: { ...process.env, PORT: port }
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user