Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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"]
4 changes: 2 additions & 2 deletions app/lib/env.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down
10 changes: 5 additions & 5 deletions docs/ENVIRONMENT_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -44,15 +44,15 @@ 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

| 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
Expand Down Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ declare module "@remix-run/node" {

export default defineConfig({
server: {
port: 5173,
port: 8080,
},
resolve: {
alias: {
Expand Down