cmc-sales/docker-compose.stg.yml
2025-09-13 22:42:31 +10:00

115 lines
2.6 KiB
YAML

services:
postfix:
image: boky/postfix
restart: unless-stopped
# Staging: relay to Mailpit (no authentication required)
environment:
- RELAYHOST=mailpit.stg.internal
- RELAYHOST_PORT=1025
- ALLOWED_SENDER_DOMAINS=*
# --- Gmail SMTP relay settings (uncomment for production) ---
# - RELAYHOST=smtp-relay.gmail.com
# - RELAYHOST_PORT=587
# - SMTP_USERNAME=sales
# - SMTP_PASSWORD=S%s'mMZ})MGsg$k!5N|mPSQ>
# - SMTP_TLS_SECURITY_LEVEL=encrypt
# - SMTP_USE_TLS=yes
# - SMTP_USE_STARTTLS=yes
ports:
- "25:25"
nginx:
image: nginx:latest
container_name: cmc-stg-nginx
hostname: nginx-stg
ports:
- "8081:80" # Staging nginx on different port
volumes:
- ./conf/nginx-site.stg.conf:/etc/nginx/conf.d/cmc.conf
- ./userpasswd:/etc/nginx/userpasswd:ro
depends_on:
- cmc-stg-php
restart: unless-stopped
networks:
- cmc-stg-network
cmc-stg-php:
build:
context: .
dockerfile: Dockerfile.stg.php
container_name: cmc-stg-php
environment:
MAIL_HOST: postfix
MAIL_PORT: 25
DB_HOST: db
DB_PORT: 3306
DB_USER: cmc
DB_PASSWORD: xVRQI&cA?7AU=hqJ!%au
DB_NAME: cmc
volumes:
- ./userpasswd:/etc/nginx/userpasswd:ro
networks:
- cmc-stg-network
restart: unless-stopped
depends_on:
- db
cmc-stg-go:
build:
context: .
dockerfile: Dockerfile.stg.go
container_name: cmc-stg-go
environment:
DB_HOST: db
DB_PORT: 3306
DB_USER: cmc
DB_PASSWORD: xVRQI&cA?7AU=hqJ!%au
DB_NAME: cmc
PORT: 8082
SMTP_HOST: postfix
SMTP_PORT: 25
SMTP_USER: ""
SMTP_PASS: ""
SMTP_FROM: "sales@cmctechnologies.com.au"
ports:
- "8082:8082"
volumes:
- /var/www/cmc-sales/app/webroot/pdf:/root/webroot/pdf:ro
networks:
- cmc-stg-network
restart: unless-stopped
depends_on:
- db
db:
build:
context: .
dockerfile: Dockerfile.stg.db
container_name: cmc-db
environment:
MYSQL_ROOT_PASSWORD: secureRootPassword
MYSQL_DATABASE: cmc
MYSQL_USER: cmc
MYSQL_PASSWORD: xVRQI&cA?7AU=hqJ!%au
volumes:
- db_data:/var/lib/mysql
ports:
- "3306:3306"
networks:
- cmc-stg-network
mailpit:
image: axllent/mailpit:latest
container_name: mailpit
ports:
- "8025:8025" # Mailpit web UI
- "1025:1025" # SMTP
networks:
- cmc-stg-network
restart: unless-stopped
networks:
cmc-stg-network:
volumes:
db_data: