This commit is contained in:
beabigegg
2025-09-12 08:54:21 +08:00
parent a2f024704c
commit 5ad4035e02
8 changed files with 246 additions and 364 deletions

View File

@@ -4,8 +4,7 @@ services:
context: .
dockerfile: Dockerfile
container_name: todolist-single-prod
ports:
- "12011:12011"
# No external port; only Nginx exposes ports
environment:
# MySQL Database Configuration
- DATABASE_URL=mysql+pymysql://A060:WLeSCi0yhtc7@mysql.theaken.com:33306/db_A060
@@ -16,7 +15,7 @@ services:
- MYSQL_DATABASE=db_A060
- MYSQL_CHARSET=utf8mb4
# CORS Configuration (allow both localhost and 127.0.0.1)
# CORS Configuration (access via 12011)
- CORS_ORIGINS=http://localhost:12011,http://127.0.0.1:12011
# LDAP Configuration (Production)
@@ -47,7 +46,8 @@ services:
- LOG_LEVEL=INFO
# Frontend API URL (now pointing to same container)
- NEXT_PUBLIC_API_URL=http://localhost:12011
# 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/"]
@@ -58,10 +58,23 @@ services:
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
driver: local