chore: 更新项目配置与Docker编排

- 将前端构建命令中的 `vue-tsc` 移除,仅保留 `vite build`
- 在 .gitignore 中添加 frontend/dist 目录
- 调整 Docker Compose 网络子网和容器端口映射
- 注释掉前端服务容器定义,便于本地开发
This commit is contained in:
hanshiyang 2026-01-27 15:19:07 +08:00
parent 450c6a99cd
commit 3a99eec597
3 changed files with 23 additions and 22 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
/.idea/
/backend/target/
/frontend/dist/
/frontend/node_modules/
/frontend/node_modules/*
/KEY_GENERATOR.md

View File

@ -5,7 +5,7 @@ networks:
driver: bridge
ipam:
config:
- subnet: 192.168.100.0/24
- subnet: 192.168.255.0/24
services:
# MySQL 数据库
@ -18,7 +18,7 @@ services:
MYSQL_DATABASE: crm_db
TZ: Asia/Shanghai
ports:
- "3306:3306"
- "39948:3306"
volumes:
- ./mysql/data:/var/lib/mysql
- ./sql/init.sql:/docker-entrypoint-initdb.d/init.sql:ro
@ -55,7 +55,7 @@ services:
SERVER_PORT: 8080
TZ: Asia/Shanghai
ports:
- "8080:8080"
- "9948:8080"
volumes:
- ./backend/logs:/app/logs
networks:
@ -67,21 +67,21 @@ services:
retries: 3
start_period: 60s
# 前端服务Nginx
crm-frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: crm-frontend
restart: always
depends_on:
- crm-backend
ports:
- "80:80"
networks:
- crm_network
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80"]
interval: 30s
timeout: 5s
retries: 3
# # 前端服务Nginx
# crm-frontend:
# build:
# context: ./frontend
# dockerfile: Dockerfile
# container_name: crm-frontend
# restart: always
# depends_on:
# - crm-backend
# ports:
# - "9948:80"
# networks:
# - crm_network
# healthcheck:
# test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80"]
# interval: 30s
# timeout: 5s
# retries: 3

View File

@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"build": "vite build",
"preview": "vite preview",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore"
},