Files
TODOLIST/docker-compose.yml
beabigegg 5ad4035e02 checkok
2025-09-12 08:54:21 +08:00

81 lines
2.2 KiB
YAML

services:
todolist-app:
build:
context: .
dockerfile: Dockerfile
container_name: todolist-single-prod
# No external port; only Nginx exposes ports
environment:
# MySQL Database Configuration
- DATABASE_URL=mysql+pymysql://A060:WLeSCi0yhtc7@mysql.theaken.com:33306/db_A060
- MYSQL_HOST=mysql.theaken.com
- MYSQL_PORT=33306
- MYSQL_USER=A060
- MYSQL_PASSWORD=WLeSCi0yhtc7
- MYSQL_DATABASE=db_A060
- MYSQL_CHARSET=utf8mb4
# CORS Configuration (access via 12011)
- CORS_ORIGINS=http://localhost:12011,http://127.0.0.1:12011
# LDAP Configuration (Production)
- USE_MOCK_LDAP=false
- LDAP_SERVER=panjit.com.tw
- LDAP_PORT=389
- LDAP_USE_SSL=false
- LDAP_BIND_USER_DN=CN=LdapBind,CN=Users,DC=PANJIT,DC=COM,DC=TW
- LDAP_BIND_USER_PASSWORD=panjit2481
- LDAP_SEARCH_BASE=OU=PANJIT,DC=panjit,DC=com,DC=tw
- LDAP_USER_LOGIN_ATTR=userPrincipalName
# SMTP Configuration
- SMTP_SERVER=mail.panjit.com.tw
- SMTP_PORT=25
- SMTP_USE_TLS=false
- SMTP_USE_SSL=false
- SMTP_AUTH_REQUIRED=false
- SMTP_SENDER_EMAIL=todo-system@panjit.com.tw
- SMTP_SENDER_PASSWORD=
# Flask Configuration
- FLASK_ENV=production
- SECRET_KEY=your-production-secret-key-change-me
- JWT_SECRET_KEY=your-jwt-secret-key-change-me
# Logging
- LOG_LEVEL=INFO
# Frontend API URL (now pointing to same container)
# Frontend uses relative API path in build; this is unused in runtime
#- NEXT_PUBLIC_API_URL=http://localhost:12011
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:12011/api/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
- todolist-network
nginx:
image: nginx:1.25-alpine
container_name: todolist-nginx
depends_on:
- todolist-app
ports:
- "12011:12011"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
restart: unless-stopped
networks:
- todolist-network
networks:
todolist-network:
driver: bridge
volumes:
app-logs:
driver: local