Initial commit

This commit is contained in:
Zhongwei Li
2025-11-30 09:05:59 +08:00
commit 37120368e6
13 changed files with 5177 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
version: '3.8'
services:
mailhog:
image: mailhog/mailhog:latest
ports:
- "1025:1025" # SMTP port
- "8025:8025" # UI/API port
environment:
- MH_HOSTNAME=mailhog.docker.local
- MH_SMTP_BIND_ADDR=0.0.0.0:1025
- MH_UI_BIND_ADDR=0.0.0.0:8025
- MH_API_BIND_ADDR=0.0.0.0:8025
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:8025/api/v1/status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Optional: MongoDB for persistent storage
mongodb:
image: mongo:latest
ports:
- "27017:27017"
environment:
- MONGO_INITDB_DATABASE=mailhog
volumes:
- mongodb_data:/data/db
- ./init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
restart: unless-stopped
# Optional: Application that uses MailHog
app:
build: .
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- SMTP_HOST=mailhog
- SMTP_PORT=1025
- MAILHOG_URL=http://mailhog:8025
depends_on:
- mailhog
volumes:
- .:/app
- /app/node_modules
command: npm run dev
volumes:
mongodb_data: