From 3ce7fb9b68068964457a782ae8e5a2a0fec89a01 Mon Sep 17 00:00:00 2001 From: Sunil Agarwal Date: Fri, 6 Feb 2026 20:26:24 +0530 Subject: [PATCH] fix():[] moving port to 8080 --- .env.example | 8 ++++---- Dockerfile | 6 +++--- app/lib/env.server.ts | 4 ++-- docs/ENVIRONMENT_SETUP.md | 10 +++++----- package.json | 2 +- vite.config.ts | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.env.example b/.env.example index 29e6a78..64c13d9 100644 --- a/.env.example +++ b/.env.example @@ -8,14 +8,14 @@ # APPLICATION # ================================== NODE_ENV=development -PORT=5173 +PORT=8080 # Public URL (accessible from client-side) # Used for: absolute URLs, redirects, social sharing, etc. # Examples: -# - Development: http://localhost:5173 +# - Development: http://localhost:8080 # - Production: https://yourdomain.com -PUBLIC_URL=http://localhost:5173 +PUBLIC_URL=http://localhost:8080 # ================================== # DATABASE @@ -59,5 +59,5 @@ SESSION_SECRET=your-secret-key-here-change-in-production # Variables with VITE_ prefix are exposed to the client # Only use for non-sensitive configuration # Example: -# VITE_API_BASE_URL=http://localhost:5173 +# VITE_API_BASE_URL=http://localhost:8080 # VITE_ENABLE_ANALYTICS=true diff --git a/Dockerfile b/Dockerfile index 7744cdd..ef95fc8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -35,7 +35,7 @@ FROM node:20-alpine AS production WORKDIR /app ENV NODE_ENV=production -ENV PORT=5173 +ENV PORT=8080 # Add non-root user for security RUN addgroup --system --gid 1001 remix && \ @@ -49,6 +49,6 @@ COPY --from=build /app/public ./public USER remix -EXPOSE 5173 +EXPOSE 8080 -CMD ["npm", "run", "start"] +CMD ["sh", "-c", "PORT=${PORT_IN:-$PORT} npm run start"] diff --git a/app/lib/env.server.ts b/app/lib/env.server.ts index a0e563c..fe25ed6 100644 --- a/app/lib/env.server.ts +++ b/app/lib/env.server.ts @@ -38,8 +38,8 @@ export function getRequiredEnv(key: string): string { export const env = { // Application NODE_ENV: getEnv("NODE_ENV") || "development", - PORT: getEnv("PORT") || "5173", - PUBLIC_URL: getEnv("PUBLIC_URL") || "http://localhost:5173", + PORT: getEnv("PORT") || "8080", + PUBLIC_URL: getEnv("PUBLIC_URL") || "http://localhost:8080", // Database (optional - only needed if using database features) DATABASE_URL: getEnv("DATABASE_URL"), diff --git a/docs/ENVIRONMENT_SETUP.md b/docs/ENVIRONMENT_SETUP.md index 3b6e5fc..5d63027 100644 --- a/docs/ENVIRONMENT_SETUP.md +++ b/docs/ENVIRONMENT_SETUP.md @@ -16,8 +16,8 @@ Edit `.env` and set the following: ```env # Application NODE_ENV=development -PORT=5173 -PUBLIC_URL=http://localhost:5173 +PORT=8080 +PUBLIC_URL=http://localhost:8080 # Database (PostgreSQL) DATABASE_URL=postgresql://user:password@localhost:5432/database_name?schema=public @@ -44,7 +44,7 @@ node -e "console.log(require('crypto').randomBytes(32).toString('base64'))" | Variable | Description | Example | |----------|-------------|---------| | `DATABASE_URL` | PostgreSQL connection string | `postgresql://user:pass@localhost:5432/db` | -| `PUBLIC_URL` | Public-facing application URL | `http://localhost:5173` | +| `PUBLIC_URL` | Public-facing application URL | `http://localhost:8080` | | `SESSION_SECRET` | Secret for session encryption | `random-32-char-string` | ### Optional Variables @@ -52,7 +52,7 @@ node -e "console.log(require('crypto').randomBytes(32).toString('base64'))" | Variable | Description | Example | |----------|-------------|---------| | `NODE_ENV` | Environment mode | `development`, `production` | -| `PORT` | Server port | `5173` | +| `PORT` | Server port | `8080` | | `DIRECT_DATABASE_URL` | Direct DB connection (pooling) | `postgresql://...` | ### Adding API Keys @@ -82,7 +82,7 @@ AWS_SECRET_ACCESS_KEY=... ### Development ```env NODE_ENV=development -PUBLIC_URL=http://localhost:5173 +PUBLIC_URL=http://localhost:8080 DATABASE_URL=postgresql://postgres:password@localhost:5432/app_dev ``` diff --git a/package.json b/package.json index 238ac8f..50f3884 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "dev": "VITE_CJS_IGNORE_WARNING=true remix vite:dev", "build": "VITE_CJS_IGNORE_WARNING=true remix vite:build", - "start": "PORT=5173 remix-serve ./build/server/index.js", + "start": "remix-serve ./build/server/index.js", "lint": "eslint .", "typecheck": "tsc", "test": "vitest run", diff --git a/vite.config.ts b/vite.config.ts index e94178a..1e1b578 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -11,7 +11,7 @@ declare module "@remix-run/node" { export default defineConfig({ server: { - port: 5173, + port: 8080, }, resolve: { alias: {