first commit

This commit is contained in:
debu-2 2026-10-03 21:14:44 +05:30
commit cce9a8c9ba
73 changed files with 8665 additions and 0 deletions

View file

@ -0,0 +1,132 @@
# App stack: frontend, backend, PostgreSQL, MongoDB
# Included by root docker-compose.yml — deploy from the repository root.
services:
postgres:
image: postgres:17-alpine
container_name: agmail-postgres
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB:-agmail_profiles}
POSTGRES_USER: ${POSTGRES_USER:-agmail}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-agmail_dev_password}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-agmail} -d ${POSTGRES_DB:-agmail_profiles}"]
interval: 5s
timeout: 5s
retries: 10
mongodb:
image: mongo:8
container_name: agmail-mongodb
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER:-agmail}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-agmail_dev_password}
MONGO_INITDB_DATABASE: ${MONGO_DATABASE:-agmail_messages}
ports:
- "${MONGO_PORT:-27017}:27017"
volumes:
- mongo_data:/data/db
healthcheck:
test:
[
"CMD",
"mongosh",
"--quiet",
"--username",
"${MONGO_ROOT_USER:-agmail}",
"--password",
"${MONGO_ROOT_PASSWORD:-agmail_dev_password}",
"--authenticationDatabase",
"admin",
"--eval",
"db.adminCommand('ping')",
]
interval: 5s
timeout: 5s
retries: 10
backend:
build:
context: ../../backend
container_name: agmail-backend
restart: unless-stopped
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-agmail}:${POSTGRES_PASSWORD:-agmail_dev_password}@postgres:5432/${POSTGRES_DB:-agmail_profiles}
MONGO_URL: mongodb://${MONGO_ROOT_USER:-agmail}:${MONGO_ROOT_PASSWORD:-agmail_dev_password}@mongodb:27017/?authSource=admin
MONGO_DATABASE: ${MONGO_DATABASE:-agmail_messages}
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET to a long random value}
PLATFORM_DOMAIN: ${PLATFORM_DOMAIN:-getall.help}
PLATFORM_SPF_INCLUDE: ${PLATFORM_SPF_INCLUDE:-_spf.getall.help}
APP_PUBLIC_HOST: ${APP_PUBLIC_HOST:-email.getall.help}
DKIM_SELECTOR: ${DKIM_SELECTOR:-agmail}
SMTP_HOST: ${SMTP_HOST:-smtp}
SMTP_PORT: ${SMTP_PORT:-25}
SMTP_PUBLIC_HOST: ${SMTP_PUBLIC_HOST:-mail.getall.help}
SMTP_USERNAME: ${SMTP_USERNAME:-}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_USE_TLS: ${SMTP_USE_TLS:-false}
SMTP_HEALTH_REQUIRED: ${SMTP_HEALTH_REQUIRED:-false}
INBOUND_SMTP_ENABLED: ${INBOUND_SMTP_ENABLED:-true}
INBOUND_SMTP_HOST: 0.0.0.0
INBOUND_SMTP_PORT: 2525
INBOUND_MAX_BYTES: ${INBOUND_MAX_BYTES:-26214400}
INBOUND_ALLOWED_CIDRS: ${INBOUND_ALLOWED_CIDRS:-["127.0.0.0/8","172.16.0.0/12"]}
GCS_RAW_MIME_BUCKET: ${GCS_RAW_MIME_BUCKET:-}
GCS_RAW_MIME_PREFIX: ${GCS_RAW_MIME_PREFIX:-raw}
GCS_PROJECT: ${GCS_PROJECT:-}
GOOGLE_APPLICATION_CREDENTIALS: /run/secrets/gcp_service_account
CORS_ORIGINS: ${CORS_ORIGINS:-["http://localhost:8080"]}
DNS_SETUP_USERNAME: ${DNS_SETUP_USERNAME:-smtp-credentia}
DNS_SETUP_PASSWORD: ${DNS_SETUP_PASSWORD:-Nishtha#01}
ports:
- "127.0.0.1:${BACKEND_PORT:-8000}:8000"
- "${INBOUND_SMTP_BIND_IP:-127.0.0.1}:${INBOUND_SMTP_PORT:-2525}:2525"
volumes:
- relay_domains_data:/data/relay_domains
secrets:
- gcp_service_account
depends_on:
postgres:
condition: service_healthy
mongodb:
condition: service_healthy
healthcheck:
test:
[
"CMD",
"python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')",
]
interval: 10s
timeout: 5s
retries: 5
frontend:
build:
context: ../../frontend
container_name: agmail-frontend
restart: unless-stopped
expose:
- "80"
ports:
- "127.0.0.1:${FRONTEND_PORT:-8080}:80"
depends_on:
backend:
condition: service_healthy
volumes:
postgres_data:
mongo_data:
relay_domains_data:
secrets:
gcp_service_account:
# /dev/null keeps local startup working before real GCS credentials exist.
file: ${GCP_CREDENTIALS_FILE:-/dev/null}