mirror of
https://github.com/remvze/moodist.git
synced 2025-12-19 01:44:15 +00:00
- 新增 Dockerfile.dev-server:类生产模式容器(无热重载干扰) - 新增 Dockerfile.prod-like:纯生产模式容器尝试 - 新增 Dockerfile.server:服务器模式容器 - 更新 docker-compose.yml:移除过时 version 字段,优化卷挂载 - 更新 .gitignore:忽略 data 目录(SQLite 数据库) - 更新 astro.config.mjs:支持服务器端渲染模式 这解决了 react-icons 在生产构建中的 ES 模块兼容性问题, 提供了稳定的生产级 Docker 部署方案。
27 lines
652 B
YAML
27 lines
652 B
YAML
services:
|
|
moodist:
|
|
image: walllee/moodist:3.0.0-prod-like
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.dev-server
|
|
logging:
|
|
options:
|
|
max-size: 1g
|
|
restart: unless-stopped
|
|
ports:
|
|
- '8080:8080'
|
|
volumes:
|
|
# 挂载源代码用于热重载(保持用户权限)
|
|
- .:/app:cached
|
|
# 使用独立的 node_modules 避免权限冲突
|
|
- node_modules_volume:/app/node_modules
|
|
# 挂载 SQLite 数据库文件和 WAL 文件
|
|
- ./data:/app/data:rw
|
|
environment:
|
|
- NODE_ENV=development
|
|
- PORT=8080
|
|
stdin_open: true
|
|
tty: true
|
|
|
|
volumes:
|
|
node_modules_volume:
|