From 60a32120e20401437aecaa42da5d0d42c7e406a2 Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Tue, 23 Dec 2025 23:59:52 -0300 Subject: [PATCH] refactor(backoffice): rename PORT to BACKOFFICE_PORT and HOST to BACKOFFICE_HOST --- backoffice/.env.example | 22 +++++++++++++++++++--- backoffice/Dockerfile | 4 ++-- backoffice/src/main.ts | 4 ++-- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/backoffice/.env.example b/backoffice/.env.example index 2a3ffbb..dbd1ca0 100644 --- a/backoffice/.env.example +++ b/backoffice/.env.example @@ -1,23 +1,39 @@ -PORT=3001 +# ============================================================================= +# GoHorse Backoffice - Environment Variables +# ============================================================================= + +# Server +BACKOFFICE_PORT=3001 +BACKOFFICE_HOST=0.0.0.0 NODE_ENV=development +# ============================================================================= # Stripe +# ============================================================================= STRIPE_SECRET_KEY=sk_test_your_stripe_secret_key STRIPE_WEBHOOK_SECRET=whsec_your_webhook_secret STRIPE_PUBLISHABLE_KEY=pk_test_your_publishable_key +# ============================================================================= # Database +# ============================================================================= DATABASE_URL=postgresql://user:password@localhost:5432/gohorse_backoffice +# ============================================================================= # JWT +# ============================================================================= JWT_SECRET=your-super-secret-jwt-key JWT_EXPIRATION=7d -# Cloudflare +# ============================================================================= +# Cloudflare API (for cache management) +# ============================================================================= CLOUDFLARE_API_TOKEN=your-cloudflare-api-token CLOUDFLARE_ZONE_ID=your-zone-id -# cPanel +# ============================================================================= +# cPanel API (for email management) +# ============================================================================= CPANEL_HOST=https://cpanel.yourdomain.com:2083 CPANEL_USERNAME=your-cpanel-username CPANEL_API_TOKEN=your-cpanel-api-token diff --git a/backoffice/Dockerfile b/backoffice/Dockerfile index a3f8414..7e0a174 100644 --- a/backoffice/Dockerfile +++ b/backoffice/Dockerfile @@ -65,8 +65,8 @@ RUN find node_modules -name "*.md" -delete 2>/dev/null || true && \ # Environment ENV NODE_ENV=production -ENV PORT=3001 -ENV HOST=0.0.0.0 +ENV BACKOFFICE_PORT=3001 +ENV BACKOFFICE_HOST=0.0.0.0 # Switch to non-root user USER nestjs diff --git a/backoffice/src/main.ts b/backoffice/src/main.ts index e6348dc..df0708e 100644 --- a/backoffice/src/main.ts +++ b/backoffice/src/main.ts @@ -86,8 +86,8 @@ async function bootstrap() { fastifyInstance.get('/health', async () => ({ status: 'ok', timestamp: new Date().toISOString() })); // Start server - const port = process.env.PORT || 3001; - const host = process.env.HOST || '0.0.0.0'; + const port = process.env.BACKOFFICE_PORT || 3001; + const host = process.env.BACKOFFICE_HOST || '0.0.0.0'; await app.listen(port, host);