56 lines
1.5 KiB
YAML
56 lines
1.5 KiB
YAML
services:
|
|
email-api:
|
|
container_name: email-api
|
|
image: node:22-slim
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5000:5000" # Map REST API port
|
|
volumes:
|
|
- ./email_api:/app
|
|
- /var/mail:/var/mail # Maildir access for health check
|
|
working_dir: /app
|
|
env_file:
|
|
- .env
|
|
environment:
|
|
- API_TOKEN=${API_TOKEN}
|
|
- AWS_REGION=${AWS_REGION}
|
|
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
|
|
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
|
|
- 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}
|
|
- PGHOST=postgres
|
|
- PGUSER=${PGUSER:-email_user}
|
|
- PGPASSWORD=${PGPASSWORD:-email_password}
|
|
- PGDATABASE=${PGDATABASE:-email_db}
|
|
- PGPORT=${PGPORT:-5432}
|
|
command: >
|
|
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
|
|
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
|
|
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
|
|
networks:
|
|
- email-network
|
|
|
|
networks:
|
|
email-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
email_postgres_data: |