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
ENV NODE_ENV=production
ENV PORT=3000
ENV PORT=7000
ENV DATA_PATH=/app/data/portal-data.json
# Copy package manifests
@ -44,12 +44,9 @@ COPY --from=builder /app/dist ./dist
# Create persistent data directory
RUN mkdir -p /app/data
# Expose server port (default 3000)
EXPOSE 3000
# Healthcheck to verify Express server status
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
CMD ["node", "dist/server.cjs"]

View file

@ -32,18 +32,17 @@ services:
depends_on:
postgres:
condition: service_healthy
ports:
# Use HOST_PORT (default 8080) to prevent conflicts if host port 3000 is already occupied by another app
- "${HOST_PORT:-8080}:3000"
port:
- "7000"
environment:
- NODE_ENV=production
- PORT=3000
- PORT=7000
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD:-postgres_secure_pass_2026}@postgres:5432/balance_sheet_db
- DATA_PATH=/app/data/portal-data.json
volumes:
- portal_data:/app/data
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
timeout: 5s
retries: 3