This commit is contained in:
2025-05-23 15:02:01 +08:00
parent c849d989fe
commit 236a1cffb8
5 changed files with 200 additions and 279 deletions

View File

@@ -3,7 +3,7 @@ version: '3.8'
services:
# MySQL Database Service
mysql-db:
image: mysql:8.0
image: mysql:5.7
container_name: mqtt_mysql_db
restart: unless-stopped
environment:
@@ -17,8 +17,8 @@ services:
- "33061:3306" # 示例将容器的3306映射到主机的33061
volumes:
- mysql_data:/var/lib/mysql
# 如果有初始化脚本,可以挂载:
# - ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql
# 挂载初始化SQL脚本当容器首次启动且数据目录为空时执行
- ./springboot-init-main/sql/mqtt_power.sql:/docker-entrypoint-initdb.d/init_schema.sql
networks:
- app-network
healthcheck:
@@ -59,7 +59,7 @@ services:
# Backend Spring Boot Application Service
backend-app:
image: your-docker-registry/mqtt-springboot-app:latest # 将在 CI/CD 中构建和推送
image: mqtt-springboot-app:latest # 修改为本地镜像名
container_name: mqtt_springboot_app_prod
restart: unless-stopped
depends_on:
@@ -95,7 +95,7 @@ services:
# Frontend Next.js Application Service
frontend-app:
image: your-docker-registry/mqtt-nextjs-app:latest # 将在 CI/CD 中构建和推送
image: mqtt-nextjs-app:latest # 修改为本地镜像名
container_name: mqtt_nextjs_app_prod
restart: unless-stopped
ports: