From 5c14645900f241824089453410c98f272923b510 Mon Sep 17 00:00:00 2001 From: Nurfog Date: Thu, 10 Sep 2026 11:46:25 -0300 Subject: [PATCH] Fix: add output standalone to next.config.ts for Docker build --- docker-compose.yml | 119 +++------------------------------------- frontend/next.config.ts | 2 +- 2 files changed, 10 insertions(+), 111 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index b496aa2..ed035f9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,126 +1,25 @@ # ============================================================ -# HelpDesk ICHN - Docker Compose Principal -# Caddy + Backend .NET 10 + Frontend Next.js 15 + PG + Redis +# HelpDesk ICHN - Frontend Docker Compose +# Solo Frontend Next.js (backend compartido en SAM) # ============================================================ -networks: - helpdesk-net: - name: helpdesk-net - driver: bridge - -volumes: - pgdata-helpdesk: - redis-data: - caddy-data: - caddy-config: - services: - # ============================================= - # GATEWAY - Caddy Reverse Proxy - # ============================================= - caddy: - image: caddy:2-alpine - container_name: helpdesk-caddy - restart: unless-stopped - ports: - - "8080:80" - - "8443:443" - volumes: - - ./gateway/Caddyfile:/etc/caddy/Caddyfile:ro - - ./gateway/certs:/certs:ro - - caddy-data:/data - - caddy-config:/config - networks: - - helpdesk-net - - # ============================================= - # BACKEND - .NET 10 (HelpDesk.API) - # ============================================= - api: - build: - context: ./backend - dockerfile: Dockerfile - container_name: helpdesk-api - restart: unless-stopped - environment: - ASPNETCORE_URLS: http://+:5000 - DB_CONNECTION: Host=helpdesk-postgres;Database=helpdesk;Username=helpdesk;Password=${PG_PASSWORD:-helpdesk_pass} - JWT_SECRET: ${JWT_SECRET:-your-super-secret-key-change-in-production-2024} - JWT_ISSUER: HelpDeskICHH - JWT_AUDIENCE: HelpDeskICHH - JWT_EXPIRY_MINUTES: "480" - FrontendUrl: http://localhost:3000 - networks: - - helpdesk-net - healthcheck: - test: ["CMD-SHELL", "pgrep -x dotnet || exit 1"] - interval: 30s - timeout: 5s - retries: 3 - start_period: 15s - depends_on: - postgres: - condition: service_healthy - - # ============================================= - # FRONTEND - Next.js 15 - # ============================================= - frontend: + helpdesk-frontend: build: context: ./frontend dockerfile: Dockerfile container_name: helpdesk-frontend restart: unless-stopped environment: - NEXT_PUBLIC_API_URL: http://localhost:5000 + NEXT_PUBLIC_API_URL: https://api.ichn.local networks: - - helpdesk-net + - sam-net healthcheck: - test: ["CMD-SHELL", "curl -f http://localhost:3000 || exit 1"] + test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"] interval: 30s timeout: 5s retries: 3 - start_period: 20s - # ============================================= - # DATABASE - PostgreSQL 16 - # ============================================= - postgres: - image: postgres:16-alpine - container_name: helpdesk-postgres - restart: unless-stopped - environment: - POSTGRES_DB: helpdesk - POSTGRES_USER: helpdesk - POSTGRES_PASSWORD: ${PG_PASSWORD:-helpdesk_pass} - volumes: - - pgdata-helpdesk:/var/lib/postgresql/data - - ./scripts/init-db.sql:/docker-entrypoint-initdb.d/01-init.sql:ro - ports: - - "5433:5432" - networks: - - helpdesk-net - healthcheck: - test: ["CMD-SHELL", "pg_isready -U helpdesk -d helpdesk"] - interval: 10s - timeout: 5s - retries: 5 - - # ============================================= - # CACHE - Redis 7 - # ============================================= - redis: - image: redis:7-alpine - container_name: helpdesk-redis - restart: unless-stopped - volumes: - - redis-data:/data - ports: - - "6381:6379" - networks: - - helpdesk-net - healthcheck: - test: ["CMD", "redis-cli", "ping"] - interval: 10s - timeout: 5s - retries: 5 +networks: + sam-net: + external: true diff --git a/frontend/next.config.ts b/frontend/next.config.ts index e9ffa30..68a6c64 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -1,7 +1,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { - /* config options here */ + output: "standalone", }; export default nextConfig;