Files
LFSpecs/docker-compose.yml
T
2026-11-06 15:07:02 +08:00

29 lines
990 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
app:
# 不在服务器上构建镜像:先跑 scripts/deploy.sh 生成 dist 与 node_modules,再由容器挂载运行。
# 原因:ECS 内存仅 1.6G,Docker 多阶段构建会触发 kcompactd 长时间阻塞。
image: node:24-slim
container_name: lfspecs
restart: unless-stopped
working_dir: /app
command: ["node", "dist/server/entry.mjs"]
ports:
# 宿主 3010 -> 容器 3000(宿主 3000 已被 frps 占用)
- "3010:3000"
volumes:
- ./dist:/app/dist
- ./node_modules:/app/node_modules
# 唯一需要持久化的目录:SQLite 与上传图片
- ./data:/app/data
# node:24-slim 不带字体;OG 图渲染文字需要挂载宿主字体
- /usr/share/fonts:/usr/share/fonts:ro
- /etc/fonts:/etc/fonts:ro
env_file:
- .env
environment:
NODE_ENV: production
HOST: 0.0.0.0
PORT: 3000
DB_PATH: /app/data/app.db
UPLOADS_DIR: /app/data/uploads