Ports fixed

This commit is contained in:
Huzaifa Inam 2026-08-07 15:00:37 +05:00
parent 87475b20b0
commit 9206c21cb9
2 changed files with 6 additions and 10 deletions

View file

@ -29,7 +29,7 @@ FROM node:20-alpine AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV PORT=3000 ENV PORT=7000
ENV DATA_PATH=/app/data/portal-data.json ENV DATA_PATH=/app/data/portal-data.json
# Copy package manifests # Copy package manifests
@ -44,12 +44,9 @@ COPY --from=builder /app/dist ./dist
# Create persistent data directory # Create persistent data directory
RUN mkdir -p /app/data RUN mkdir -p /app/data
# Expose server port (default 3000)
EXPOSE 3000
# Healthcheck to verify Express server status # Healthcheck to verify Express server status
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \ HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1 CMD wget --no-verbose --tries=1 --spider http://localhost:7000/api/health || exit 1
# Start production application server # Start production application server
CMD ["node", "dist/server.cjs"] CMD ["node", "dist/server.cjs"]

View file

@ -32,18 +32,17 @@ services:
depends_on: depends_on:
postgres: postgres:
condition: service_healthy condition: service_healthy
ports: port:
# Use HOST_PORT (default 8080) to prevent conflicts if host port 3000 is already occupied by another app - "7000"
- "${HOST_PORT:-8080}:3000"
environment: environment:
- NODE_ENV=production - NODE_ENV=production
- PORT=3000 - PORT=7000
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgres_secure_pass_2026}@postgres:5432/balance_sheet_db - DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgres_secure_pass_2026}@postgres:5432/balance_sheet_db
- DATA_PATH=/app/data/portal-data.json - DATA_PATH=/app/data/portal-data.json
volumes: volumes:
- portal_data:/app/data - portal_data:/app/data
healthcheck: healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"] test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:7000/api/health"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3