From b8fc26dc469212e7efe92f636eac7efea4bcebd5 Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Mon, 7 Jul 2025 15:05:22 -0500 Subject: [PATCH] Port change --- email_api/docker-compose.yml | 20 ++++++++++++++------ email_api/email_api/app.js | 2 +- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/email_api/docker-compose.yml b/email_api/docker-compose.yml index 7527534..da111e2 100644 --- a/email_api/docker-compose.yml +++ b/email_api/docker-compose.yml @@ -1,11 +1,10 @@ -version: '3.8' - services: email-api: container_name: email-api image: node:22-slim restart: unless-stopped - network_mode: host + ports: + - "5000:5000" # Map REST API port volumes: - ./email_api:/app - /var/mail:/var/mail # Maildir access for health check @@ -17,7 +16,7 @@ services: - AWS_REGION=${AWS_REGION} - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} - - SMTP_HOST=${SMTP_HOST:-localhost} + - SMTP_HOST=${SMTP_HOST:-smtp} # Reference SMTP service or external host - SMTP_PORT=${SMTP_PORT:-25} - MAILCOW_API_KEY=${MAILCOW_API_KEY} - MAILCOW_API=${MAILCOW_API} @@ -30,19 +29,28 @@ services: bash -c "npm install && node app.js" depends_on: - postgres + networks: + - email-network postgres: container_name: email-api-postgres image: postgres:16 restart: unless-stopped - network_mode: host + ports: + - "5433:5432" # Map container port 5432 to host port 5433 environment: - POSTGRES_USER=${PGUSER:-email_user} - POSTGRES_PASSWORD=${PGPASSWORD:-email_password} - POSTGRES_DB=${PGDATABASE:-email_db} volumes: - - email_postgres_data:/var/lib/postgresql/data + - postgres_data:/var/lib/postgresql/data - ./init.sql:/docker-entrypoint-initdb.d/init.sql + networks: + - email-network + +networks: + email-network: + driver: bridge volumes: email_postgres_data: \ No newline at end of file diff --git a/email_api/email_api/app.js b/email_api/email_api/app.js index edaa69a..859292d 100644 --- a/email_api/email_api/app.js +++ b/email_api/email_api/app.js @@ -43,7 +43,7 @@ const pool = new Pool({ password: process.env.PGPASSWORD || 'email_password', host: process.env.PGHOST || 'postgres', database: process.env.PGDATABASE || 'email_db', - port: parseInt(process.env.PGPORT || '5432', 10) + port: parseInt(process.env.PGPORT || '5433', 10) }); // AWS S3 client